Javascript backend fixed to compile with new Core Types

Hi, I have fixed the Javascript backend to accomodate the new type layout in Core (primitives and functions got an unified type). Changes have been pushed to the repo. No new functionality was added. At least this demo program: http://www.golubovsky.org/repos/hibb/EchoCPS.hs compiles to this web page: http://www.golubovsky.org/repos/hibb/EchoCPS.html Those who experiment with the Javascript backend please try compiling your programs and let me know if anything went broke. Thanks. -- Dimitry Golubovsky Anywhere on the Web

I am getting this error when I try to import UnsafeJS into a program:
$ make EchoCPS.html
yhc -includes /usr/lib/haskell -linkcore EchoCPS.hs
Compiling UnsafeJS ( UnsafeJS.hs )
Warning: foreign import/export has non-primitive type: Prelude.[]
Compiling DOM.Level1.Dom ( ../../../../usr/lib/haskell/DOM/Level1/Dom.hs )
Compiling DOM.Level1.Document (
../../../../usr/lib/haskell/DOM/Level1/Document.hs )
Compiling DOM.Level1.Html ( ../../../../usr/lib/haskell/DOM/Level1/Html.hs
)
Compiling DOM.Level1.HTMLDivElement (
../../../../usr/lib/haskell/DOM/Level1/HTMLDivElement.hs )
Compiling DOM.Level1.HTMLInputElement (
../../../../usr/lib/haskell/DOM/Level1/HTMLInputElement.hs )
Compiling DOM.Level1.HTMLElement (
../../../../usr/lib/haskell/DOM/Level1/HTMLElement.hs )
Compiling CDOM.Level1.Events (
../../../../usr/lib/haskell/CDOM/Level1/Events.hs )
Compiling DOM.Level1.HTMLDocument (
../../../../usr/lib/haskell/DOM/Level1/HTMLDocument.hs )
Compiling DOM.Level1.Node ( ../../../../usr/lib/haskell/DOM/Level1/Node.hs
)
Compiling CDOM.Level1.DomUtils (
../../../../usr/lib/haskell/CDOM/Level1/DomUtils.hs )
Compiling Roman ( Roman.hs )
Compiling Debug.Profiling ( ../../../../usr/lib/haskell/Debug/Profiling.hs
)
Compiling EchoCPS ( EchoCPS.hs )
yhc: user error (invalid binary data found)
make: *** [EchoCPS.html] Error 1
On 5/25/07, Dimitry Golubovsky
Hi,
I have fixed the Javascript backend to accomodate the new type layout in Core (primitives and functions got an unified type).
Changes have been pushed to the repo. No new functionality was added. At least this demo program:
http://www.golubovsky.org/repos/hibb/EchoCPS.hs
compiles to this web page:
http://www.golubovsky.org/repos/hibb/EchoCPS.html
Those who experiment with the Javascript backend please try compiling your programs and let me know if anything went broke.
Thanks.
-- Dimitry Golubovsky
Anywhere on the Web

Hi David,
As a first shot, try deleting any .ycr and .yca files you have sitting
around - the format changed recently which can result in these invalid
binary data messages.
Thanks
Neil
On 6/2/07, David Fox
I am getting this error when I try to import UnsafeJS into a program:
$ make EchoCPS.html yhc -includes /usr/lib/haskell -linkcore EchoCPS.hs Compiling UnsafeJS ( UnsafeJS.hs ) Warning: foreign import/export has non-primitive type: Prelude.[]
Compiling DOM.Level1.Dom ( ../../../../usr/lib/haskell/DOM/Level1/Dom.hs ) Compiling DOM.Level1.Document ( ../../../../usr/lib/haskell/DOM/Level1/Document.hs ) Compiling DOM.Level1.Html ( ../../../../usr/lib/haskell/DOM/Level1/Html.hs ) Compiling DOM.Level1.HTMLDivElement ( ../../../../usr/lib/haskell/DOM/Level1/HTMLDivElement.hs ) Compiling DOM.Level1.HTMLInputElement ( ../../../../usr/lib/haskell/DOM/Level1/HTMLInputElement.hs ) Compiling DOM.Level1.HTMLElement ( ../../../../usr/lib/haskell/DOM/Level1/HTMLElement.hs ) Compiling CDOM.Level1.Events ( ../../../../usr/lib/haskell/CDOM/Level1/Events.hs ) Compiling DOM.Level1.HTMLDocument ( ../../../../usr/lib/haskell/DOM/Level1/HTMLDocument.hs ) Compiling DOM.Level1.Node ( ../../../../usr/lib/haskell/DOM/Level1/Node.hs ) Compiling CDOM.Level1.DomUtils ( ../../../../usr/lib/haskell/CDOM/Level1/DomUtils.hs ) Compiling Roman ( Roman.hs ) Compiling Debug.Profiling ( ../../../../usr/lib/haskell/Debug/Profiling.hs ) Compiling EchoCPS ( EchoCPS.hs ) yhc: user error (invalid binary data found)
make: *** [EchoCPS.html] Error 1
On 5/25/07, Dimitry Golubovsky
wrote: Hi,
I have fixed the Javascript backend to accomodate the new type layout in Core (primitives and functions got an unified type).
Changes have been pushed to the repo. No new functionality was added. At least this demo program:
http://www.golubovsky.org/repos/hibb/EchoCPS.hs
compiles to this web page:
http://www.golubovsky.org/repos/hibb/EchoCPS.html
Those who experiment with the Javascript backend please try compiling your programs and let me know if anything went broke.
Thanks.
-- Dimitry Golubovsky
Anywhere on the Web
_______________________________________________ Yhc mailing list Yhc@haskell.org http://www.haskell.org/mailman/listinfo/yhc

I'm pretty sure it is related to the UnsafeJS.ycr file produced by the new
compiler. I did an strace and the error occurred right after reading
/usr/lib/haskell/UnsafeJS.ycr, which was built during the build of the new
compiler. When I copy UnsafeJS.hs into my working directory and compile,
the crash comes right after reading the just compiled local file
./UnsafeJS.ycr.
On 6/2/07, Neil Mitchell
Hi David,
As a first shot, try deleting any .ycr and .yca files you have sitting around - the format changed recently which can result in these invalid binary data messages.
Thanks
Neil
On 6/2/07, David Fox
wrote: I am getting this error when I try to import UnsafeJS into a program:
$ make EchoCPS.html yhc -includes /usr/lib/haskell -linkcore EchoCPS.hs Compiling UnsafeJS ( UnsafeJS.hs ) Warning: foreign import/export has non-primitive type: Prelude.[]
Compiling DOM.Level1.Dom ( ../../../../usr/lib/haskell/DOM/Level1/Dom.hs ) Compiling DOM.Level1.Document ( ../../../../usr/lib/haskell/DOM/Level1/Document.hs ) Compiling DOM.Level1.Html ( ../../../../usr/lib/haskell/DOM/Level1/Html.hs ) Compiling DOM.Level1.HTMLDivElement ( ../../../../usr/lib/haskell/DOM/Level1/HTMLDivElement.hs ) Compiling DOM.Level1.HTMLInputElement ( ../../../../usr/lib/haskell/DOM/Level1/HTMLInputElement.hs ) Compiling DOM.Level1.HTMLElement ( ../../../../usr/lib/haskell/DOM/Level1/HTMLElement.hs ) Compiling CDOM.Level1.Events ( ../../../../usr/lib/haskell/CDOM/Level1/Events.hs ) Compiling DOM.Level1.HTMLDocument ( ../../../../usr/lib/haskell/DOM/Level1/HTMLDocument.hs ) Compiling DOM.Level1.Node ( ../../../../usr/lib/haskell/DOM/Level1/Node.hs ) Compiling CDOM.Level1.DomUtils ( ../../../../usr/lib/haskell/CDOM/Level1/DomUtils.hs ) Compiling Roman ( Roman.hs ) Compiling Debug.Profiling ( ../../../../usr/lib/haskell/Debug/Profiling.hs ) Compiling EchoCPS ( EchoCPS.hs ) yhc: user error (invalid binary data found)
make: *** [EchoCPS.html] Error 1
On 5/25/07, Dimitry Golubovsky
wrote: Hi,
I have fixed the Javascript backend to accomodate the new type layout in Core (primitives and functions got an unified type).
Changes have been pushed to the repo. No new functionality was added. At least this demo program:
http://www.golubovsky.org/repos/hibb/EchoCPS.hs
compiles to this web page:
http://www.golubovsky.org/repos/hibb/EchoCPS.html
Those who experiment with the Javascript backend please try compiling your programs and let me know if anything went broke.
Thanks.
-- Dimitry Golubovsky
Anywhere on the Web
_______________________________________________ Yhc mailing list Yhc@haskell.org http://www.haskell.org/mailman/listinfo/yhc

Aha! My build procedure has a flaw. After I build the new compiler I go
into src/translator/js and build there, but the Makefile in there uses the
old compiler. I had to add YHC=$(CURDIR)/inst/yh
YHC_BASE_PATH=$(CURDIR)/inst to the make arguments.
On 6/2/07, David Fox
I'm pretty sure it is related to the UnsafeJS.ycr file produced by the new compiler. I did an strace and the error occurred right after reading /usr/lib/haskell/UnsafeJS.ycr, which was built during the build of the new compiler. When I copy UnsafeJS.hs into my working directory and compile, the crash comes right after reading the just compiled local file ./UnsafeJS.ycr.
On 6/2/07, Neil Mitchell
wrote: Hi David,
As a first shot, try deleting any .ycr and .yca files you have sitting around - the format changed recently which can result in these invalid binary data messages.
Thanks
Neil
On 6/2/07, David Fox
wrote: I am getting this error when I try to import UnsafeJS into a program:
$ make EchoCPS.html yhc -includes /usr/lib/haskell -linkcore EchoCPS.hs Compiling UnsafeJS ( UnsafeJS.hs ) Warning: foreign import/export has non-primitive type: Prelude.[]
Compiling DOM.Level1.Dom ( ../../../../usr/lib/haskell/DOM/Level1/Dom.hs ) Compiling DOM.Level1.Document ( ../../../../usr/lib/haskell/DOM/Level1/Document.hs ) Compiling DOM.Level1.Html ( ../../../../usr/lib/haskell/DOM/Level1/Html.hs ) Compiling DOM.Level1.HTMLDivElement ( ../../../../usr/lib/haskell/DOM/Level1/HTMLDivElement.hs ) Compiling DOM.Level1.HTMLInputElement ( ../../../../usr/lib/haskell/DOM/Level1/HTMLInputElement.hs ) Compiling DOM.Level1.HTMLElement ( ../../../../usr/lib/haskell/DOM/Level1/HTMLElement.hs ) Compiling CDOM.Level1.Events ( ../../../../usr/lib/haskell/CDOM/Level1/Events.hs ) Compiling DOM.Level1.HTMLDocument ( ../../../../usr/lib/haskell/DOM/Level1/HTMLDocument.hs ) Compiling DOM.Level1.Node ( ../../../../usr/lib/haskell/DOM/Level1/Node.hs ) Compiling CDOM.Level1.DomUtils ( ../../../../usr/lib/haskell/CDOM/Level1/DomUtils.hs ) Compiling Roman ( Roman.hs ) Compiling Debug.Profiling ( ../../../../usr/lib/haskell/Debug/Profiling.hs ) Compiling EchoCPS ( EchoCPS.hs ) yhc: user error (invalid binary data found)
make: *** [ EchoCPS.html] Error 1
On 5/25/07, Dimitry Golubovsky
wrote: Hi,
I have fixed the Javascript backend to accomodate the new type layout in Core (primitives and functions got an unified type).
Changes have been pushed to the repo. No new functionality was added. At least this demo program:
http://www.golubovsky.org/repos/hibb/EchoCPS.hs
compiles to this web page:
http://www.golubovsky.org/repos/hibb/EchoCPS.html
Those who experiment with the Javascript backend please try compiling your programs and let me know if anything went broke.
Thanks.
-- Dimitry Golubovsky
Anywhere on the Web
_______________________________________________ Yhc mailing list Yhc@haskell.org http://www.haskell.org/mailman/listinfo/yhc

Hi David,
Aha! My build procedure has a flaw. After I build the new compiler I go into src/translator/js and build there, but the Makefile in there uses the old compiler. I had to add YHC=$(CURDIR)/inst/yh YHC_BASE_PATH=$(CURDIR)/inst to the make arguments.
Can this be added in general? Hopefully we are going to move over to having ycr2js built into the standard Yhc build system at some point soon. Thanks Neil

David,
On 6/2/07, David Fox
I am getting this error when I try to import UnsafeJS into a program: [skip] yhc: user error (invalid binary data found)
Please make sure you regenerated _ALL_ ycr files that might have existed before the core format/version upgrade. This error is caused by the deserializer when it encounters a core file with older version. -- Dimitry Golubovsky Anywhere on the Web
participants (3)
-
David Fox
-
Dimitry Golubovsky
-
Neil Mitchell