Hello
I'd like to compile https://github.com/amber-smalltalk/amber-examples/blob/master/nodejs/hello/Hello.st I do amberc Hello.st and I get [Error: File not found: /usr/support/boot.js] How do I call amberc? amberc --help gives a wealth of information and according to the info there I do not see why it should not work. Regards Hannes -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Hi!
Can you try after updating amber-cli? npm uninstall -g amber npm install -g amber-cli Cheers, Nico H. Hirzel writes: > Hello > > I'd like to compile > > https://github.com/amber-smalltalk/amber-examples/blob/master/nodejs/hello/Hello.st > > I do > > amberc Hello.st > > and I get > > [Error: File not found: /usr/support/boot.js] > > How do I call amberc? > > amberc --help > > gives a wealth of information and according to the info there I do not > see why it should not work. > > Regards > Hannes -- Nicolas Petton http://nicolas-petton.fr -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Thank you for the answer, Nico. It now compiles.
After npm uninstall -g amber npm install -g amber-cli amberc Hello.st compiles fine to Hello.js Now a next question: How do I execute Hello.js or how to I compile Hello.st that node Hello.js executes fine? See error message below, 'define' not defined. Regards Hannes -------------------------------------------------------- node Hello.js /home/hhzl/Documents/chronoA/B-Amber-Doc/Hello.js:1 (function (exports, require, module, __filename, __dirname) { define("amber_co ^ ReferenceError: define is not defined at Object.<anonymous> (/home/hhzl/Documents/chronoA/B-Amber-Doc/Hello.js:1:63) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:901:3 On 4/22/14, Nicolas Petton <[hidden email]> wrote: > Hi! > > Can you try after updating amber-cli? > > npm uninstall -g amber > npm install -g amber-cli > > Cheers, > Nico > > H. Hirzel writes: > >> Hello >> >> I'd like to compile >> >> >> https://github.com/amber-smalltalk/amber-examples/blob/master/nodejs/hello/Hello.st >> >> I do >> >> amberc Hello.st >> >> and I get >> >> [Error: File not found: /usr/support/boot.js] >> >> How do I call amberc? >> >> amberc --help >> >> gives a wealth of information and according to the info there I do not >> see why it should not work. >> >> Regards >> Hannes > > > -- > Nicolas Petton > http://nicolas-petton.fr > > -- > You received this message because you are subscribed to the Google Groups > "amber-lang" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [hidden email]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Answer from
amberc --help Compile with amberc -m Hello Hello.st myProg Then execute node myProg.js It works fine. --Hannes On 4/22/14, H. Hirzel <[hidden email]> wrote: > Thank you for the answer, Nico. It now compiles. > > After > > npm uninstall -g amber > npm install -g amber-cli > > amberc Hello.st > > compiles fine to Hello.js > > Now a next question: How do I execute Hello.js or how to I compile Hello.st > that > > node Hello.js > > executes fine? See error message below, 'define' not defined. > > Regards > Hannes > > > -------------------------------------------------------- > > node Hello.js > > /home/hhzl/Documents/chronoA/B-Amber-Doc/Hello.js:1 > (function (exports, require, module, __filename, __dirname) { > define("amber_co > ^ > ReferenceError: define is not defined > at Object.<anonymous> > (/home/hhzl/Documents/chronoA/B-Amber-Doc/Hello.js:1:63) > at Module._compile (module.js:456:26) > at Object.Module._extensions..js (module.js:474:10) > at Module.load (module.js:356:32) > at Function.Module._load (module.js:312:12) > at Function.Module.runMain (module.js:497:10) > at startup (node.js:119:16) > at node.js:901:3 > > On 4/22/14, Nicolas Petton <[hidden email]> wrote: >> Hi! >> >> Can you try after updating amber-cli? >> >> npm uninstall -g amber >> npm install -g amber-cli >> >> Cheers, >> Nico >> >> H. Hirzel writes: >> >>> Hello >>> >>> I'd like to compile >>> >>> >>> https://github.com/amber-smalltalk/amber-examples/blob/master/nodejs/hello/Hello.st >>> >>> I do >>> >>> amberc Hello.st >>> >>> and I get >>> >>> [Error: File not found: /usr/support/boot.js] >>> >>> How do I call amberc? >>> >>> amberc --help >>> >>> gives a wealth of information and according to the info there I do not >>> see why it should not work. >>> >>> Regards >>> Hannes >> >> >> -- >> Nicolas Petton >> http://nicolas-petton.fr >> >> -- >> You received this message because you are subscribed to the Google Groups >> "amber-lang" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [hidden email]. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
H. Hirzel writes: > Answer from > > amberc --help > > Compile with > > amberc -m Hello Hello.st myProg > > Then execute > > node myProg.js > > It works fine. cool :) Nico -- Nicolas Petton http://nicolas-petton.fr -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Hello again,
A variant of a Hello World program: write the hello message to a file. ------------------------------------------------------------------------------------------------------ File: WriteHello.st ------------------------------------------------------------------------------------------------------ Object subclass: #WriteHello instanceVariableNames: '' package: 'WriteHello'! !WriteHello class methodsFor: 'main'! main | fs | console log: '...check file message.txt'. fs := require value: 'fs'. fs writeFileSync: 'message.txt' content: 'Hello from Amber' errFn: nil. ! ! Compile with amberc -m WriteHello WriteHello.st myProg Execute with node myProg.js Works fine. Writes a file message.txt However instead of nil an error function should be given Something like fs writeFileSync: 'message.txt' content: 'Hello from Amber' errFn: [ theErr | "process theErr"]. I get a RethrowErrorHandler does not understand #handleError:] see http://www.nodejs.org/api/fs.html#fs_fs_readfilesync_filename_options How should the block look like? Regards Hannes On 4/22/14, Nicolas Petton <[hidden email]> wrote: > > H. Hirzel writes: > >> Answer from >> >> amberc --help >> >> Compile with >> >> amberc -m Hello Hello.st myProg >> >> Then execute >> >> node myProg.js >> >> It works fine. > > cool :) > > Nico > -- > Nicolas Petton > http://nicolas-petton.fr > > -- > You received this message because you are subscribed to the Google Groups > "amber-lang" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [hidden email]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
This was fixed in master. Could you give it a try?
Nico H. Hirzel writes: > Hello again, > > A variant of a Hello World program: > > write the hello message to a file. > > ------------------------------------------------------------------------------------------------------ > File: WriteHello.st > ------------------------------------------------------------------------------------------------------ > Object subclass: #WriteHello > instanceVariableNames: '' > package: 'WriteHello'! > > !WriteHello class methodsFor: 'main'! > > main > | fs | > > console log: '...check file message.txt'. > > fs := require value: 'fs'. > > fs writeFileSync: 'message.txt' content: 'Hello from Amber' > errFn: nil. > > ! ! > > Compile with > > amberc -m WriteHello WriteHello.st myProg > > Execute with > > node myProg.js > > > Works fine. Writes a file message.txt > > > However instead of nil an error function should be given > > Something like > > fs writeFileSync: 'message.txt' content: 'Hello from Amber' > errFn: [ theErr | "process theErr"]. > > I get > > a RethrowErrorHandler does not understand #handleError:] > > see http://www.nodejs.org/api/fs.html#fs_fs_readfilesync_filename_options > > How should the block look like? > > Regards > > Hannes > > On 4/22/14, Nicolas Petton <[hidden email]> wrote: >> >> H. Hirzel writes: >> >>> Answer from >>> >>> amberc --help >>> >>> Compile with >>> >>> amberc -m Hello Hello.st myProg >>> >>> Then execute >>> >>> node myProg.js >>> >>> It works fine. >> >> cool :) >> >> Nico >> -- >> Nicolas Petton >> http://nicolas-petton.fr >> >> -- >> You received this message because you are subscribed to the Google Groups >> "amber-lang" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [hidden email]. >> For more options, visit https://groups.google.com/d/optout. >> -- Nicolas Petton http://nicolas-petton.fr -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
global amberc uses amber from 0.12.4 tag. It is needed to use -d option to point it to different amber location to use the current version (like, -d ..\bower_components\amber or so).
Nicolas Petton wrote: > This was fixed in master. Could you give it a try? > > Nico > > H. Hirzel writes: > >> Hello again, >> >> A variant of a Hello World program: >> >> write the hello message to a file. >> >> ------------------------------------------------------------------------------------------------------ >> File: WriteHello.st >> ------------------------------------------------------------------------------------------------------ >> Object subclass: #WriteHello >> instanceVariableNames: '' >> package: 'WriteHello'! >> >> !WriteHello class methodsFor: 'main'! >> >> main >> | fs | >> >> console log: '...check file message.txt'. >> >> fs := require value: 'fs'. >> >> fs writeFileSync: 'message.txt' content: 'Hello from Amber' >> errFn: nil. >> >> ! ! >> >> Co >> >> amberc -m WriteHello WriteHello.st myProg >> >> Execute with >> >> node myProg.js >> >> >> Works fine. Writes a file message.txt >> >> >> However instead of nil an error function should be given >> >> Something like >> >> fs writeFileSync: 'message.txt' content: 'Hello from Amber' >> errFn: [ theErr | "process theErr"]. >> >> I get >> >> a RethrowErrorHandler does not understand #handleError:] >> >> see http://www.nodejs.org/api/fs.html#fs_fs_readfilesync_filename_options >> >> How should the block look like? >> >> Regards >> >> Hannes >> >> On 4/22/14, Nicolas Petton<[hidden email]> wrote: >>> H. Hirzel writes: >>> >>>> Answer from >>>> >>>> amberc --help >>>> >>>> Compile with >>>> >>>> amberc -m Hello Hello.st myProg >>>> >>>> Then execute >>>> >>>> node myProg.js >>>> >>>> It works fine. >>> cool :) >>> >>> Nico >>> -- >>> Nicolas Petton >>> http://nicolas-petton.fr >>> >>> -- >>> You received this message because yo >>> "amber-lang" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [hidden email]. >>> For more options, visit https://groups.google.com/d/optout. >>> > > -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Thank you but I need more clarification.
How do the steps look like? 1. Download/clone latestest amber 2. amberc call with -d option? --Hannes On 4/22/14, Herby Vojčík <[hidden email]> wrote: > global amberc uses amber from 0.12.4 tag. It is needed to use -d option to > point it to different amber location to use the current version (like, -d > ..\bower_components\amber or so). > > Nicolas Petton wrote: >> This was fixed in master. Could you give it a try? >> >> Nico >> >> H. Hirzel writes: >> >>> Hello again, >>> >>> A variant of a Hello World program: >>> >>> write the hello message to a file. >>> >>> ------------------------------------------------------------------------------------------------------ >>> File: WriteHello.st >>> ------------------------------------------------------------------------------------------------------ >>> Object subclass: #WriteHello >>> instanceVariableNames: '' >>> package: 'WriteHello'! >>> >>> !WriteHello class methodsFor: 'main'! >>> >>> main >>> | fs | >>> >>> console log: '...check file message.txt'. >>> >>> fs := require value: 'fs'. >>> >>> fs writeFileSync: 'message.txt' content: 'Hello from Amber' >>> errFn: nil. >>> >>> ! ! >>> >>> Co > mpile with >>> >>> amberc -m WriteHello WriteHello.st myProg >>> >>> Execute with >>> >>> node myProg.js >>> >>> >>> Works fine. Writes a file message.txt >>> >>> >>> However instead of nil an error function should be given >>> >>> Something like >>> >>> fs writeFileSync: 'message.txt' content: 'Hello from Amber' >>> errFn: [ theErr | "process theErr"]. >>> >>> I get >>> >>> a RethrowErrorHandler does not understand #handleError:] >>> >>> see >>> http://www.nodejs.org/api/fs.html#fs_fs_readfilesync_filename_options >>> >>> How should the block look like? >>> >>> Regards >>> >>> Hannes >>> >>> On 4/22/14, Nicolas Petton<[hidden email]> wrote: >>>> H. Hirzel writes: >>>> >>>>> Answer from >>>>> >>>>> amberc --help >>>>> >>>>> Compile with >>>>> >>>>> amberc -m Hello Hello.st myProg >>>>> >>>>> Then execute >>>>> >>>>> node myProg.js >>>>> >>>>> It works fine. >>>> cool :) >>>> >>>> Nico >>>> -- >>>> Nicolas Petton >>>> http://nicolas-petton.fr >>>> >>>> -- >>>> You received this message because yo > u are subscribed to the Google Groups >>>> "amber-lang" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an >>>> email to [hidden email]. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >> >> > > -- > You received this message because you are subscribed to the Google Groups > "amber-lang" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [hidden email]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by Hannes Hirzel
"H. Hirzel" <[hidden email]>napísal/a: Thank you but I need more clarification. How do the steps look like? 1. Download/clone latestest amber 2. amberc call with -d option? The 2. is always there, of course. As for 1. you can do it as you wish - either point to some location (preferably external) where you keep latest ambet, or just use latest instead of tagged in project itself: do `bower uninstall amber --save` to remove stable amber, and then `bower install git://github.com/amber-smalltalk/amber.git#master` to get the master (it changes your bower.json from "I am using latest stable amber in 0.12 line" to "I am using master branch from git directly"). --Hannes On 4/22/14, Herby Vojčík <[hidden email]> wrote: > global amberc uses amber from 0.12.4 tag. It is needed to use -d option to > point it to different amber location to use the current version (like, -d > ..\bower_components\amber or so). > > Nicolas Petton wrote: >> This was fixed in master. Could you give it a try? >> >> Nico >> >> H. Hirzel writes: >> >>> Hello again, >>> >>> A variant of a Hello World program: >>> >>> write the hello message to a file. >>> >>> ------------------------------------------------------------------------------------------------------ >>> File: WriteHello.st >>> ------------------------------------------------------------------------------------------------------ >>> Object subclass: #WriteHello >>> instanceVariableNames: '' >>> package: 'WriteHello'! >>> >>> !WriteHello class methodsFor: 'main'! >>> >>> main >>> | fs | >>> >>> console log: '...check file message.txt'. >>> >>> fs := require value: 'fs'. >>> >>> fs writeFileSync: 'message.txt' content: 'Hello from Amber' >>> errFn: nil. >>> >>> ! ! >>> >>> Co > mpile with >>> >>> amberc -m WriteHello WriteHello.st myProg >>> >>> Execute with >>> >>> node myProg.js >>> >>> >>> Works fine. Writes a file message.txt >>> >>> >>> However instead of nil an error function should be given >>> >>> Something like >>> >>> fs writeFileSync: 'message.txt' content: 'Hello from Amber' >>> errFn: [ theErr | "process theErr"]. >>> >>> I get >>> >>> a RethrowErrorHandler does not understand #handleError:] >>> >>> see >>> http://www.nodejs.org/api/fs.html#fs_fs_readfilesync_filename_options >>> >>> How should the block look like? >>> >>> Regards >>> >>> Hannes >>> >>> On 4/22/14, Nicolas Petton<[hidden email]> wrote: >>>> H. Hirzel writes: >>>> >>>>> Answer from >>>>> >>>>> amberc --help >>>>> >>>>> Compile with >>>>> >>>>> amberc -m Hello Hello.st myProg >>>>> >>>>> Then execute >>>>> >>>>> node myProg.js >>>>> >>>>> It works fine. >>>> cool :) >>>> >>>> Nico >>>> -- >>>> Nicolas Petton >>>> http://nicolas-petton.fr >>>> >>>> -- >>>> You received this message because yo > u are subscribed to the Google Groups >>>> "amber-lang" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an >>>> email to [hidden email]. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >> >> > > -- > You received this message because you are subscribed to the Google Groups > "amber-lang" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [hidden email]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by Hannes Hirzel
I loaded a recent client side amber with
bower install git://github.com/amber-smalltalk/amber.git#master --save Then I use the -d option to get the client side Amber class library amberc -d ./bower_components/amber/src -v -m WriteHello WriteHello.st myProg or without the src subdirectory amberc -d ./bower_components/amber -v -m WriteHello WriteHello.st myProg and ./bower_components/amber/bin/amberc -d ./bower_components/amber/src -v -m WriteHello WriteHello.st myProg In all cases I get the log I copy in below. It seems that the -d option does not work.. Interesting to note that the files like smalltalk.js get loaded twice. --Hannes ---------------------------------------------------------------------------------------------- LOG ---------------------------------------------------------------------------------------------- Resolving: WriteHello.st Resolving: boot.js Resolving: smalltalk.js Resolving: globals.js Resolving: nil.js Resolving: _st.js Resolving: Kernel-Objects.js Resolving: Kernel-Classes.js Resolving: Kernel-Methods.js Resolving: Kernel-Collections.js Resolving: Kernel-Infrastructure.js Resolving: Kernel-Exceptions.js Resolving: Kernel-Transcript.js Resolving: Kernel-Announcements.js Resolving: boot.js Resolving: smalltalk.js Resolving: globals.js Resolving: nil.js Resolving: _st.js Resolving: Kernel-Objects.js Resolving: Kernel-Classes.js Resolving: Kernel-Methods.js Resolving: Kernel-Collections.js Resolving: Kernel-Infrastructure.js Resolving: Kernel-Exceptions.js Resolving: Kernel-Transcript.js Resolving: Kernel-Announcements.js Resolving: parser.js Resolving: Kernel-ImportExport.js Resolving: Compiler-Exceptions.js Resolving: Compiler-Core.js Resolving: Compiler-AST.js Resolving: Compiler-Exceptions.js Resolving: Compiler-IR.js Resolving: Compiler-Inlining.js Resolving: Compiler-Semantic.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/support/boot.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/support/smalltalk.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/support/globals.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/support/nil.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/support/_st.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Objects.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Classes.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Methods.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Collections.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Infrastructure.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Exceptions.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Transcript.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Announcements.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/support/parser.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-ImportExport.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-Exceptions.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-Core.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-AST.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-Exceptions.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-IR.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-Inlining.js Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-Semantic.js Compiler loaded Reading: WriteHello.st Compiling collected .st files [Error: Compiler error in section: WriteHello class methodsFor: 'main' while processing chunk: main | fs | console log: '...check file message.txt'. fs := require value: 'fs'. fs writeFileSync: 'message.txt' content: 'Hello from Amber' errFn: [ theErr | "process theErr"]. a RethrowErrorHandler does not understand #handleError:] On 4/22/14, H. Hirzel <[hidden email]> wrote: > Thank you but I need more clarification. > > How do the steps look like? > > 1. Download/clone latestest amber > 2. amberc call with -d option? > > --Hannes > > On 4/22/14, Herby Vojčík <[hidden email]> wrote: >> global amberc uses amber from 0.12.4 tag. It is needed to use -d option >> to >> point it to different amber location to use the current version (like, -d >> ..\bower_components\amber or so). >> >> Nicolas Petton wrote: >>> This was fixed in master. Could you give it a try? >>> >>> Nico >>> >>> H. Hirzel writes: >>> >>>> Hello again, >>>> >>>> A variant of a Hello World program: >>>> >>>> write the hello message to a file. >>>> >>>> ------------------------------------------------------------------------------------------------------ >>>> File: WriteHello.st >>>> ------------------------------------------------------------------------------------------------------ >>>> Object subclass: #WriteHello >>>> instanceVariableNames: '' >>>> package: 'WriteHello'! >>>> >>>> !WriteHello class methodsFor: 'main'! >>>> >>>> main >>>> | fs | >>>> >>>> console log: '...check file message.txt'. >>>> >>>> fs := require value: 'fs'. >>>> >>>> fs writeFileSync: 'message.txt' content: 'Hello from Amber' >>>> errFn: nil. >>>> >>>> ! ! >>>> >>>> Co >> mpile with >>>> >>>> amberc -m WriteHello WriteHello.st myProg >>>> >>>> Execute with >>>> >>>> node myProg.js >>>> >>>> >>>> Works fine. Writes a file message.txt >>>> >>>> >>>> However instead of nil an error function should be given >>>> >>>> Something like >>>> >>>> fs writeFileSync: 'message.txt' content: 'Hello from Amber' >>>> errFn: [ theErr | "process theErr"]. >>>> >>>> I get >>>> >>>> a RethrowErrorHandler does not understand #handleError:] >>>> >>>> see >>>> http://www.nodejs.org/api/fs.html#fs_fs_readfilesync_filename_options >>>> >>>> How should the block look like? >>>> >>>> Regards >>>> >>>> Hannes >>>> >>>> On 4/22/14, Nicolas Petton<[hidden email]> wrote: >>>>> H. Hirzel writes: >>>>> >>>>>> Answer from >>>>>> >>>>>> amberc --help >>>>>> >>>>>> Compile with >>>>>> >>>>>> amberc -m Hello Hello.st myProg >>>>>> >>>>>> Then execute >>>>>> >>>>>> node myProg.js >>>>>> >>>>>> It works fine. >>>>> cool :) >>>>> >>>>> Nico >>>>> -- >>>>> Nicolas Petton >>>>> http://nicolas-petton.fr >>>>> >>>>> -- >>>>> You received this message because yo >> u are subscribed to the Google Groups >>>>> "amber-lang" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an >>>>> email to [hidden email]. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>> >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "amber-lang" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [hidden email]. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Thanks, I'll check that.
Nico H. Hirzel writes: > I loaded a recent client side amber with > > bower install git://github.com/amber-smalltalk/amber.git#master --save > > > Then I use the -d option to get the client side Amber class library > > amberc -d ./bower_components/amber/src -v -m WriteHello > WriteHello.st myProg > > or without the src subdirectory > > amberc -d ./bower_components/amber -v -m WriteHello WriteHello.st myProg > > and > > ./bower_components/amber/bin/amberc -d > ./bower_components/amber/src -v -m WriteHello WriteHello.st myProg > > > In all cases I get the log I copy in below. It seems that the -d > option does not work.. > Interesting to note that the files like smalltalk.js get loaded twice. > > --Hannes > > > > ---------------------------------------------------------------------------------------------- > LOG > ---------------------------------------------------------------------------------------------- > > > Resolving: WriteHello.st > Resolving: boot.js > Resolving: smalltalk.js > Resolving: globals.js > Resolving: nil.js > Resolving: _st.js > Resolving: Kernel-Objects.js > Resolving: Kernel-Classes.js > Resolving: Kernel-Methods.js > Resolving: Kernel-Collections.js > Resolving: Kernel-Infrastructure.js > Resolving: Kernel-Exceptions.js > Resolving: Kernel-Transcript.js > Resolving: Kernel-Announcements.js > Resolving: boot.js > Resolving: smalltalk.js > Resolving: globals.js > Resolving: nil.js > Resolving: _st.js > Resolving: Kernel-Objects.js > Resolving: Kernel-Classes.js > Resolving: Kernel-Methods.js > Resolving: Kernel-Collections.js > Resolving: Kernel-Infrastructure.js > Resolving: Kernel-Exceptions.js > Resolving: Kernel-Transcript.js > Resolving: Kernel-Announcements.js > Resolving: parser.js > Resolving: Kernel-ImportExport.js > Resolving: Compiler-Exceptions.js > Resolving: Compiler-Core.js > Resolving: Compiler-AST.js > Resolving: Compiler-Exceptions.js > Resolving: Compiler-IR.js > Resolving: Compiler-Inlining.js > Resolving: Compiler-Semantic.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/support/boot.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/support/smalltalk.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/support/globals.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/support/nil.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/support/_st.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Objects.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Classes.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Methods.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Collections.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Infrastructure.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Exceptions.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Transcript.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-Announcements.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/support/parser.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Kernel-ImportExport.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-Exceptions.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-Core.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-AST.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-Exceptions.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-IR.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-Inlining.js > Loading file: /usr/local/lib/node_modules/amber-cli/node_modules/amber/src/Compiler-Semantic.js > Compiler loaded > Reading: WriteHello.st > Compiling collected .st files > [Error: Compiler error in section: > WriteHello class methodsFor: 'main' > > while processing chunk: > main > | fs | > > console log: '...check file message.txt'. > > fs := require value: 'fs'. > > fs writeFileSync: 'message.txt' content: 'Hello from Amber' > errFn: [ theErr | "process theErr"]. > > a RethrowErrorHandler does not understand #handleError:] > > On 4/22/14, H. Hirzel <[hidden email]> wrote: >> Thank you but I need more clarification. >> >> How do the steps look like? >> >> 1. Download/clone latestest amber >> 2. amberc call with -d option? >> >> --Hannes >> >> On 4/22/14, Herby Vojčík <[hidden email]> wrote: >>> global amberc uses amber from 0.12.4 tag. It is needed to use -d option >>> to >>> point it to different amber location to use the current version (like, -d >>> ..\bower_components\amber or so). >>> >>> Nicolas Petton wrote: >>>> This was fixed in master. Could you give it a try? >>>> >>>> Nico >>>> >>>> H. Hirzel writes: >>>> >>>>> Hello again, >>>>> >>>>> A variant of a Hello World program: >>>>> >>>>> write the hello message to a file. >>>>> >>>>> ------------------------------------------------------------------------------------------------------ >>>>> File: WriteHello.st >>>>> ------------------------------------------------------------------------------------------------------ >>>>> Object subclass: #WriteHello >>>>> instanceVariableNames: '' >>>>> package: 'WriteHello'! >>>>> >>>>> !WriteHello class methodsFor: 'main'! >>>>> >>>>> main >>>>> | fs | >>>>> >>>>> console log: '...check file message.txt'. >>>>> >>>>> fs := require value: 'fs'. >>>>> >>>>> fs writeFileSync: 'message.txt' content: 'Hello from Amber' >>>>> errFn: nil. >>>>> >>>>> ! ! >>>>> >>>>> Co >>> mpile with >>>>> >>>>> amberc -m WriteHello WriteHello.st myProg >>>>> >>>>> Execute with >>>>> >>>>> node myProg.js >>>>> >>>>> >>>>> Works fine. Writes a file message.txt >>>>> >>>>> >>>>> However instead of nil an error function should be given >>>>> >>>>> Something like >>>>> >>>>> fs writeFileSync: 'message.txt' content: 'Hello from Amber' >>>>> errFn: [ theErr | "process theErr"]. >>>>> >>>>> I get >>>>> >>>>> a RethrowErrorHandler does not understand #handleError:] >>>>> >>>>> see >>>>> http://www.nodejs.org/api/fs.html#fs_fs_readfilesync_filename_options >>>>> >>>>> How should the block look like? >>>>> >>>>> Regards >>>>> >>>>> Hannes >>>>> >>>>> On 4/22/14, Nicolas Petton<[hidden email]> wrote: >>>>>> H. Hirzel writes: >>>>>> >>>>>>> Answer from >>>>>>> >>>>>>> amberc --help >>>>>>> >>>>>>> Compile with >>>>>>> >>>>>>> amberc -m Hello Hello.st myProg >>>>>>> >>>>>>> Then execute >>>>>>> >>>>>>> node myProg.js >>>>>>> >>>>>>> It works fine. >>>>>> cool :) >>>>>> >>>>>> Nico >>>>>> -- >>>>>> Nicolas Petton >>>>>> http://nicolas-petton.fr >>>>>> >>>>>> -- >>>>>> You received this message because yo >>> u are subscribed to the Google Groups >>>>>> "amber-lang" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>>> an >>>>>> email to [hidden email]. >>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>> >>>> >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "amber-lang" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [hidden email]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- Nicolas Petton http://nicolas-petton.fr -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Administrator
|
In reply to this post by Hannes Hirzel
"theErr" should be ":theErr" ?
Cheers,
Sean |
Administrator
|
In reply to this post by Hannes Hirzel
There are three problems: 1) a syntax error in your error block - "theErr" should be ":theErr" 2) a bug in the compiler that doesn't properly report the error - the easiest thing to do would be to patch the global amber-cli: cd /usr/local/lib/node_modules/amber-cli npm uninstall amber npm install git://github.com/amber-smalltalk/amber.git#master Now the error will be properly reported: Parse error on line 9 column 38 : Unexpected character ]] instead of a RethrowErrorHandler does not understand #handleError:] 3) Using bower to install from master doesn't seem to do the right thing bower uninstall amber --save Now if you: bower install git://github.com/amber-smalltalk/amber.git#master --save and then: vi bower_components/amber/src/Compiler-Exceptions.st You'll see that the implementation of RethrowErrorHandler>>#handleError: is the out-dated (i.e. 0.12.4) version: handleError: anError super handleError: anError. self basicSignal: anError But if you instead specify the last commit to #master: bower install git://github.com/amber-smalltalk/amber.git#ad803005739b17a6466df63382eaae29ceaf9695 --save Then it will be the correct implementation (i.e. from #master): handleError: anError self basicSignal: anError Given #3 above, maybe the problem is not that -d is not working, but that it points to a still out-of-date version of amber. HTH
Cheers,
Sean |
Crystal clear :-)
-- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by Hannes Hirzel
"Sean P. DeNigris" <[hidden email]>napísal/a: H. Hirzel wrote 3) Using bower to install from master doesn't seem to do the right thing bower uninstall amber --save Now if you: bower install git://github.com/amber-smalltalk/amber.git#master --save and then: vi bower_components/amber/src/Compiler-Exceptions.st You'll see that the implementation of RethrowErrorHandler>>#handleError: is the out-dated (i.e. 0.12.4) version: handleError: anError super handleError: anError. self basicSignal: anError But if you instead specify the last commit to #master: bower install git://github.com/amber-smalltalk/amber.git#ad803005739b17a6466df63382eaae29ceaf9695 --save Then it will be the correct implementation (i.e. from #master): handleError: anError self basicSignal: anError This id strange thsy bower fails to install from master branch... another thing you can do is install from git without #mastet at the end, that shpuld be taking the head. Or there may be something with bower cache, which you can try to clean wittj bower cache clean. Given #3 above, maybe the problem is not that -d is not working, but that it points to a still out-of-date version of amber. HTH ----- Cheers, Sean -- View this message in context: http://forum.world.st/Compiling-Hello-st-with-amberc-on-the-command-line-tp4755716p4756064.html Sent from the Amber Smalltalk mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by Sean P. DeNigris
Retesting ....
On 4/23/14, Sean P. DeNigris <[hidden email]> wrote: > H. Hirzel wrote >> I loaded a recent client side amber with >> bower install git://github.com/amber-smalltalk/amber.git#master >> --save >> ... >> errFn: [ theErr | "process theErr"]. >> >> a RethrowErrorHandler does not understand #handleError:] > > There are three problems: > > 1) a syntax error in your error block - "theErr" should be ":theErr" When I change "theErr" to ":theErr" it compiles. But there still is a run-time error. Even after having done point 2 below. > 2) a bug in the compiler that doesn't properly report the error - the > easiest thing to do would be to patch the global amber-cli: > cd /usr/local/lib/node_modules/amber-cli > npm uninstall amber > npm install git://github.com/amber-smalltalk/amber.git#master Worked fine. I had to use sudo npm install git://github.com/amber-smalltalk/amber.git#master on LInux Mint (based on Ubuntu 12.04) > Now the error will be properly reported: > Parse error on line 9 column 38 : Unexpected character ]] > instead of > a RethrowErrorHandler does not understand #handleError:] Yes, a proper error message. > 3) Using bower to install from master doesn't seem to do the right thing > bower uninstall amber --save > Now if you: > bower install git://github.com/amber-smalltalk/amber.git#master --save > and then: > vi bower_components/amber/src/Compiler-Exceptions.st > You'll see that the implementation of RethrowErrorHandler>>#handleError: is > the out-dated (i.e. 0.12.4) version: > handleError: anError > super handleError: anError. > self basicSignal: anError > But if you instead specify the last commit to #master: > bower install > git://github.com/amber-smalltalk/amber.git#ad803005739b17a6466df63382eaae29ceaf9695 > --save > Then it will be the correct implementation (i.e. from #master): > handleError: anError > self basicSignal: anError I can confirm that git://github.com/amber-smalltalk/amber.git#ad803005739b17a6466df63382eaae29ceaf9695 --save installs a version with a different #handleError implementation. > Given #3 above, maybe the problem is not that -d is not working, but that > it > points to a still out-of-date version of amber. The -d option still does not seem to work. And Herby's suggestion to go without #master bower install git://github.com/amber-smalltalk/amber.git does not bring the correct version. --Hannes > Cheers, > Sean > -- > View this message in context: > http://forum.world.st/Compiling-Hello-st-with-amberc-on-the-command-line-tp4755716p4756064.html > Sent from the Amber Smalltalk mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by Hannes Hirzel
"H. Hirzel" <[hidden email]>napísal/a: Retesting .... And Herby's suggestion to go without #master bower install git://github.com/amber-smalltalk/amber.git does not bring the correct version. Did you uninstall it before? -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Redid a test
mkdir test cd test bower cache clean bower install git://github.com/amber-smalltalk/amber.git gedit bower_components/amber/src/Compiler-Exceptions.st find RethrowErrorHandler handleError: anError super handleError: anError. self basicSignal: anError Which is supposed to be still the 12.04 version as Sean wrote. However at the moment this is not such much an issue anymore because with the instructions Sean sent for the cli version I could update the cli version and the error it reports if fine. Later I will send a summary of the whole thread - Test code - Issues which are still open. --Hannes On 4/24/14, Herby Vojčík <[hidden email]> wrote: > > > "H. Hirzel" <[hidden email]>napísal/a: > > Retesting .... > > > And Herby's suggestion to go without #master > > bower install git://github.com/amber-smalltalk/amber.git > > does not bring the correct version. > > Did you uninstall it before? > -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Hello
this is a retest of a hello world program on the command line RESULT: It compiles with an error QUESTION: What is the cause of this? amber version gives Welcome to Amber version 0.13.0-pre (NodeJS 0.10.25). ------------------------------------------------ Smalltalk file: HelloFromAmber.st ------------------------------------------------ Object subclass: #HelloFromAmber instanceVariableNames: '' package: 'Hello'! !HelloFromAmber class methodsFor: 'main'! main | fs | console log: '...write a file'. fs := require value: 'fs'. fs writeFileSync: 'message.txt' content: 'Hello from Amber' errFn: [ theErr | "process theErr" console log: 'there was an error writing the file']. It compiles with an error hhzl@hhzl-Latitude-E6400 ~/Documents $ amberc -m HelloFromAmber HelloFromAmber.st theCompiledProg Reading: HelloFromAmber.st [Error: Compiler error in section: HelloFromAmber class methodsFor: 'main' while processing chunk: [object Object] nil does not understand #isEmpty] Regards Hannes On 4/24/14, H. Hirzel <[hidden email]> wrote: > Redid a test > > mkdir test > cd test > bower cache clean > bower install git://github.com/amber-smalltalk/amber.git > gedit bower_components/amber/src/Compiler-Exceptions.st > > find > RethrowErrorHandler > > > handleError: anError > super handleError: anError. > self basicSignal: anError > > Which is supposed to be still the 12.04 version as Sean wrote. > > However at the moment this is not such much an issue anymore because > with the instructions Sean sent for the cli version I could update the > cli version and the error it reports if fine. > > Later I will send a summary of the whole thread > > - Test code > - Issues which are still open. > > --Hannes > > > On 4/24/14, Herby Vojčík <[hidden email]> wrote: >> >> >> "H. Hirzel" <[hidden email]>napísal/a: >> >> Retesting .... >> >> >> And Herby's suggestion to go without #master >> >> bower install git://github.com/amber-smalltalk/amber.git >> >> does not bring the correct version. >> >> Did you uninstall it before? >> > -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Free forum by Nabble | Edit this page |