[Pharo-project] Jtalk, a Smalltalk for web developers
Hi, I would like to share a project I'm working on on my spare time: Jtalk Smalltalk. http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk Jtalk is an implementation of the Smalltalk language that compiles into JavaScript. Some features: - it is written in itself (including the parser/compiler) - it is self-contained - it compiles into efficient JS code - it uses the Squeak chunk format - Pharo is considered as the reference implementation I think Jtalk can be compared to CoffeeScript[1], Objective-J[2] or Clamato[3], from which it reuses some ideas and code. Jtalk includes an IDE with a class browser, transcript and workspace, an HTML canvas similar to Seaside and a jQuery binding. It is still a young piece of code, and some important features are still missing/incomplete. Cheers, Nicolas Petton [1] http://jashkenas.github.com/coffee-script/ [2] http://cappuccino.org/ [3] http://clamato.net
Hi all, To add with Aida/Web plans how we will use Jtalk: I namely see very nice oportunity to cross the border from server to the client (web browser) with Smalltalk! That is, we can build web apps in pure Smalltalk and run them on the client, unchanged. Even more, we can partition the app and decide where to run, part on server, part on client, whole on server, whole on client... And this can be done at runtime! So, Nicolas work actually opens a whole new horizon for Smalltalk on the web development front. That's why Jtalk will already be part of next version of Aida, for experimentation purposes for start. So, thanks a lot, Nico! Best regards Janko On 14. 03. 2011 19:36, Nicolas Petton wrote:
Hi,
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Some features: - it is written in itself (including the parser/compiler) - it is self-contained - it compiles into efficient JS code - it uses the Squeak chunk format - Pharo is considered as the reference implementation
I think Jtalk can be compared to CoffeeScript[1], Objective-J[2] or Clamato[3], from which it reuses some ideas and code.
Jtalk includes an IDE with a class browser, transcript and workspace, an HTML canvas similar to Seaside and a jQuery binding.
It is still a young piece of code, and some important features are still missing/incomplete.
Cheers, Nicolas Petton
[1] http://jashkenas.github.com/coffee-script/ [2] http://cappuccino.org/ [3] http://clamato.net
-- Janko Mivšek Svetovalec za informatiko Eranova d.o.o. Ljubljana, Slovenija www.eranova.si tel: 01 514 22 55 faks: 01 514 22 56 gsm: 031 674 565
2011/3/14 Janko Mivšek <janko.mivsek@eranova.si>
Hi all,
To add with Aida/Web plans how we will use Jtalk: I namely see very nice oportunity to cross the border from server to the client (web browser) with Smalltalk! That is, we can build web apps in pure Smalltalk and run them on the client, unchanged. Even more, we can partition the app and decide where to run, part on server, part on client, whole on server, whole on client... And this can be done at runtime!
So, Nicolas work actually opens a whole new horizon for Smalltalk on the web development front. That's why Jtalk will already be part of next version of Aida, for experimentation purposes for start.
Sounds a lot to GWT but for Smalltalk :) Cool!
So, thanks a lot, Nico!
Best regards Janko
On 14. 03. 2011 19:36, Nicolas Petton wrote:
Hi,
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Some features: - it is written in itself (including the parser/compiler) - it is self-contained - it compiles into efficient JS code - it uses the Squeak chunk format - Pharo is considered as the reference implementation
I think Jtalk can be compared to CoffeeScript[1], Objective-J[2] or Clamato[3], from which it reuses some ideas and code.
Jtalk includes an IDE with a class browser, transcript and workspace, an HTML canvas similar to Seaside and a jQuery binding.
It is still a young piece of code, and some important features are still missing/incomplete.
Cheers, Nicolas Petton
[1] http://jashkenas.github.com/coffee-script/ [2] http://cappuccino.org/ [3] http://clamato.net
-- Janko Mivšek Svetovalec za informatiko Eranova d.o.o. Ljubljana, Slovenija www.eranova.si tel: 01 514 22 55 faks: 01 514 22 56 gsm: 031 674 565
Thanks nicolas I want to have a look at your code :). Stef On Mar 14, 2011, at 7:36 PM, Nicolas Petton wrote:
Hi,
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Some features: - it is written in itself (including the parser/compiler) - it is self-contained - it compiles into efficient JS code - it uses the Squeak chunk format - Pharo is considered as the reference implementation
I think Jtalk can be compared to CoffeeScript[1], Objective-J[2] or Clamato[3], from which it reuses some ideas and code.
Jtalk includes an IDE with a class browser, transcript and workspace, an HTML canvas similar to Seaside and a jQuery binding.
It is still a young piece of code, and some important features are still missing/incomplete.
Cheers, Nicolas Petton
[1] http://jashkenas.github.com/coffee-script/ [2] http://cappuccino.org/ [3] http://clamato.net
Le lundi 14 mars 2011 à 21:53 +0100, Stéphane Ducasse a écrit :
Thanks nicolas I want to have a look at your code :).
Sure, you can browse the code from the class browser (available in the web page) or directly the st source in the chunk format here: https://github.com/NicolasPetton/jtalk/tree/master/st Cheers, Nicolas
Stef
On Mar 14, 2011, at 7:36 PM, Nicolas Petton wrote:
Hi,
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Some features: - it is written in itself (including the parser/compiler) - it is self-contained - it compiles into efficient JS code - it uses the Squeak chunk format - Pharo is considered as the reference implementation
I think Jtalk can be compared to CoffeeScript[1], Objective-J[2] or Clamato[3], from which it reuses some ideas and code.
Jtalk includes an IDE with a class browser, transcript and workspace, an HTML canvas similar to Seaside and a jQuery binding.
It is still a young piece of code, and some important features are still missing/incomplete.
Cheers, Nicolas Petton
[1] http://jashkenas.github.com/coffee-script/ [2] http://cappuccino.org/ [3] http://clamato.net
Impressive. I am curious to see what we can build at the top of. Alexandre On 14 Mar 2011, at 17:02, Nicolas Petton wrote:
Le lundi 14 mars 2011 à 21:53 +0100, Stéphane Ducasse a écrit :
Thanks nicolas I want to have a look at your code :).
Sure, you can browse the code from the class browser (available in the web page) or directly the st source in the chunk format here: https://github.com/NicolasPetton/jtalk/tree/master/st
Cheers, Nicolas
Stef
On Mar 14, 2011, at 7:36 PM, Nicolas Petton wrote:
Hi,
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Some features: - it is written in itself (including the parser/compiler) - it is self-contained - it compiles into efficient JS code - it uses the Squeak chunk format - Pharo is considered as the reference implementation
I think Jtalk can be compared to CoffeeScript[1], Objective-J[2] or Clamato[3], from which it reuses some ideas and code.
Jtalk includes an IDE with a class browser, transcript and workspace, an HTML canvas similar to Seaside and a jQuery binding.
It is still a young piece of code, and some important features are still missing/incomplete.
Cheers, Nicolas Petton
[1] http://jashkenas.github.com/coffee-script/ [2] http://cappuccino.org/ [3] http://clamato.net
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
I like very much the idea! Noury On 14 mars 2011, at 19:36, Nicolas Petton wrote:
Hi,
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Some features: - it is written in itself (including the parser/compiler) - it is self-contained - it compiles into efficient JS code - it uses the Squeak chunk format - Pharo is considered as the reference implementation
I think Jtalk can be compared to CoffeeScript[1], Objective-J[2] or Clamato[3], from which it reuses some ideas and code.
Jtalk includes an IDE with a class browser, transcript and workspace, an HTML canvas similar to Seaside and a jQuery binding.
It is still a young piece of code, and some important features are still missing/incomplete.
Cheers, Nicolas Petton
[1] http://jashkenas.github.com/coffee-script/ [2] http://cappuccino.org/ [3] http://clamato.net
Noury Bouraqadi http://car.mines-douai.fr/noury -- -6th National Conference on âControl Architecture of Robotsâ 24-25 may 2011, Grenoble area, France http://car2011.inrialpes.fr/ -19th ESUG International Smalltalk Conference 22-26 August 2011, Edinburgh, UK http://www.esug.org/Conferences/2011 -19èmes Journées Francophones sur les Systèmes Multi-Agents (JFSMAâ11) http://www.univ-valenciennes.fr/congres/jfsma2011/ 17-19 Octobre 2011, Valenciennes, France
I will read the rest :) eval: aString ^{'return eval(aString);'} ! visitBlockNode: aNode stream nextPutAll: '(function('. aNode parameters do: [:each | stream nextPutAll: each] separatedBy: [stream nextPutAll: ', ']. stream nextPutAll: '){'. aNode nodes do: [:each | self visit: each]. stream nextPutAll: '})' visitMethodNode: aNode | str currentSelector | currentSelector := aNode selector asSelector. nestedBlocks := 0. earlyReturn := false. stream nextPutAll: 'smalltalk.method({', String cr; nextPutAll: 'selector: "', aNode selector, '",', String cr; nextPutAll: 'source: unescape("', aNode source escaped, '"),', String cr; nextPutAll: 'fn: function('. aNode arguments do: [:each | stream nextPutAll: each] separatedBy: [stream nextPutAll: ', ']. stream nextPutAll: '){', String cr; nextPutAll: 'var self=this;', String cr. str := stream. stream := '' writeStream. aNode nodes do: [:each | self visit: each]. earlyReturn ifTrue: [ str nextPutAll: 'try{']. str nextPutAll: stream contents. stream := str. stream nextPutAll: String cr; nextPutAll: 'return self;'. earlyReturn ifTrue: [ stream nextPutAll: String cr, '} catch(e) {if(e.name === ''stReturn'' && e.selector === ', currentSelector printString, '){return e.fn()} throw(e)}']. stream nextPutAll: '}', String cr; nextPutAll: '})' ok now I understand. Stef
On 14 Mar 2011, at 19:36, Nicolas Petton wrote:
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Really impressive! Senders/Implementers would be nice to browse the code. Since the implementation is relatively small, it makes an excellent example of how to implement Smalltalk. Sven PS: On Safari, the 'Class Browser' button does not seem to work.
On 3/15/11, Sven Van Caekenberghe <sven@beta9.be> wrote: ....
Since the implementation is relatively small, it makes an excellent example of how to implement Smalltalk.
Yes, the download of the Javascript files is just 160kB. And the license is MIT! Hannes
Le mardi 15 mars 2011 à 12:10 +0000, Hannes Hirzel a écrit :
On 3/15/11, Sven Van Caekenberghe <sven@beta9.be> wrote: ....
Since the implementation is relatively small, it makes an excellent example of how to implement Smalltalk.
Yes, the download of the Javascript files is just 160kB. This is with the Smalltalk sources. Without it, it will be much smaller for deployment.
Cheers, Nicolas
And the license is MIT!
Hannes _______________________________________________ seaside mailing list seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Le mardi 15 mars 2011 à 10:53 +0100, Sven Van Caekenberghe a écrit :
On 14 Mar 2011, at 19:36, Nicolas Petton wrote:
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Really impressive!
Thanks :)
Senders/Implementers would be nice to browse the code.
Yes, the IDE is very immature. Code checking before compiling is missing, and better browsing tools too. The class browser isn't even able to commit changes to disk yet.
PS: On Safari, the 'Class Browser' button does not seem to work.
It should work now. Cheers, Nicolas
Beautifull and elegant. Nice, that you used PP. (Though the name is a little bit boring ;) But if that is the worst, one can say about it... :D On Tue, Mar 15, 2011 at 11:04 AM, Craig Latta <craig@netjam.org> wrote:
Yay! :)
-C
-- Craig Latta www.netjam.org/resume +31 06 2757 7177 + 1 415 287 3547
Uh oh, there are many jtalks already: - the text to speach jquery plugin - an hiragana converter - a blog service - a japanese text to speach system - an android app On Tue, Mar 15, 2011 at 11:41 AM, Richard Durr <richard.durr@googlemail.com>wrote:
Beautifull and elegant. Nice, that you used PP. (Though the name is a little bit boring ;) But if that is the worst, one can say about it... :D
On Tue, Mar 15, 2011 at 11:04 AM, Craig Latta <craig@netjam.org> wrote:
Yay! :)
-C
-- Craig Latta www.netjam.org/resume <%2B31%20%2006%202757%207177>+31 06 2757 7177 <%2B%201%20415%20%20287%203547>+ 1 415 287 3547
On 2011-Mar-14, at 14:36 , Nicolas Petton wrote:
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Cool! I took a look at the jtalk.deploy.js file and it looks pretty readable. It's long been on my to-do list to do something like this, but I was thinking of developing in the Pharo/Squeak image and then deploying to JS (translating Smaltalk bytecode to JS). Your jtalk.deploy.js would provide a great platform for that. But maybe the bytecode->JS translator is already part of your system, or in your plans? As for the name, I was going to suggest that you might try jstalk, but then I found: http://jstalk.berlios.de/ ../Dave
Le 2011å¹´03æ14æ¥ 19:36, Nicolas Petton a écrit :
Hi,
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Impressive ! Hilaire
As far as I can see, the only way to call external Javascript is by writing Javascript-Code directly into a method like so: doSomethingWith: anObject {'return SOMELIBRARY.doSomething(anObject); '} is this correct? The OMETA based Smalltalk->JS translator seem to let one use st-syntax for direct access to javascript like so: doSomethingWith: anObject [ SOMELIBRARY doSomething: anObject. ] and CoffeeScript can use JS seamlessly in the same way. Best regards, RD On Mon, Mar 14, 2011 at 7:36 PM, Nicolas Petton <petton.nicolas@gmail.com>wrote:
Hi,
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Some features: - it is written in itself (including the parser/compiler) - it is self-contained - it compiles into efficient JS code - it uses the Squeak chunk format - Pharo is considered as the reference implementation
I think Jtalk can be compared to CoffeeScript[1], Objective-J[2] or Clamato[3], from which it reuses some ideas and code.
Jtalk includes an IDE with a class browser, transcript and workspace, an HTML canvas similar to Seaside and a jQuery binding.
It is still a young piece of code, and some important features are still missing/incomplete.
Cheers, Nicolas Petton
[1] http://jashkenas.github.com/coffee-script/ [2] http://cappuccino.org/ [3] http://clamato.net
More compilers which compile from a dynamic language to JavaScript https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compi... Smalltalk not mentioned yet .... --Hannes On 3/21/11, Richard Durr <richard.durr@googlemail.com> wrote:
As far as I can see, the only way to call external Javascript is by writing Javascript-Code directly into a method like so: doSomethingWith: anObject {'return SOMELIBRARY.doSomething(anObject); '}
is this correct? The OMETA based Smalltalk->JS translator seem to let one use st-syntax for direct access to javascript like so:
doSomethingWith: anObject [ SOMELIBRARY doSomething: anObject. ]
and CoffeeScript can use JS seamlessly in the same way.
Best regards, RD
On Mon, Mar 14, 2011 at 7:36 PM, Nicolas Petton <petton.nicolas@gmail.com>wrote:
Hi,
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Some features: - it is written in itself (including the parser/compiler) - it is self-contained - it compiles into efficient JS code - it uses the Squeak chunk format - Pharo is considered as the reference implementation
I think Jtalk can be compared to CoffeeScript[1], Objective-J[2] or Clamato[3], from which it reuses some ideas and code.
Jtalk includes an IDE with a class browser, transcript and workspace, an HTML canvas similar to Seaside and a jQuery binding.
It is still a young piece of code, and some important features are still missing/incomplete.
Cheers, Nicolas Petton
[1] http://jashkenas.github.com/coffee-script/ [2] http://cappuccino.org/ [3] http://clamato.net
Le lundi 21 mars 2011 à 10:17 +0100, Richard Durr a écrit :
As far as I can see, the only way to call external Javascript is by writing Javascript-Code directly into a method like so: doSomethingWith: anObject {'return SOMELIBRARY.doSomething(anObject); '}
is this correct?
No, you can call JS functions with: #basicPerform: and #basicPerform:withArguments: Cheers, Nicolas
The OMETA based Smalltalk->JS translator seem to let one use st-syntax for direct access to javascript like so:
doSomethingWith: anObject [ SOMELIBRARY doSomething: anObject. ]
and CoffeeScript can use JS seamlessly in the same way.
Best regards, RD
On Mon, Mar 14, 2011 at 7:36 PM, Nicolas Petton <petton.nicolas@gmail.com> wrote: Hi,
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Some features: - it is written in itself (including the parser/compiler) - it is self-contained - it compiles into efficient JS code - it uses the Squeak chunk format - Pharo is considered as the reference implementation
I think Jtalk can be compared to CoffeeScript[1], Objective-J[2] or Clamato[3], from which it reuses some ideas and code.
Jtalk includes an IDE with a class browser, transcript and workspace, an HTML canvas similar to Seaside and a jQuery binding.
It is still a young piece of code, and some important features are still missing/incomplete.
Cheers, Nicolas Petton
[1] http://jashkenas.github.com/coffee-script/ [2] http://cappuccino.org/ [3] http://clamato.net
Is SOMELIBRARY then reachable at all? SOMELIBRARY basicPerform: #doSomething withArguments: (Array with: anObject ), ? On Fri, Mar 25, 2011 at 2:58 PM, Nicolas Petton <petton.nicolas@gmail.com>wrote:
Le lundi 21 mars 2011 à 10:17 +0100, Richard Durr a écrit :
As far as I can see, the only way to call external Javascript is by writing Javascript-Code directly into a method like so: doSomethingWith: anObject {'return SOMELIBRARY.doSomething(anObject); '}
is this correct?
No, you can call JS functions with: #basicPerform: and #basicPerform:withArguments:
Cheers, Nicolas
The OMETA based Smalltalk->JS translator seem to let one use st-syntax for direct access to javascript like so:
doSomethingWith: anObject [ SOMELIBRARY doSomething: anObject. ]
and CoffeeScript can use JS seamlessly in the same way.
Best regards, RD
On Mon, Mar 14, 2011 at 7:36 PM, Nicolas Petton <petton.nicolas@gmail.com> wrote: Hi,
I would like to share a project I'm working on on my spare time: Jtalk Smalltalk.
http://nicolaspetton.github.com/jtalk https://github.com/NicolasPetton/jtalk
Jtalk is an implementation of the Smalltalk language that compiles into JavaScript.
Some features: - it is written in itself (including the parser/compiler) - it is self-contained - it compiles into efficient JS code - it uses the Squeak chunk format - Pharo is considered as the reference implementation
I think Jtalk can be compared to CoffeeScript[1], Objective-J[2] or Clamato[3], from which it reuses some ideas and code.
Jtalk includes an IDE with a class browser, transcript and workspace, an HTML canvas similar to Seaside and a jQuery binding.
It is still a young piece of code, and some important features are still missing/incomplete.
Cheers, Nicolas Petton
[1] http://jashkenas.github.com/coffee-script/ [2] http://cappuccino.org/ [3] http://clamato.net
Le dimanche 27 mars 2011 à 01:28 +0100, Richard Durr a écrit :
Is SOMELIBRARY then reachable at all? SOMELIBRARY basicPerform: #doSomething withArguments: (Array with: anObject ), ?
Not currently. The reason is that Jtalk doesn't extend Object.prototype. But as I said, Jtalk is still young, there are tons of things to do :) Cheers, Nico
On Fri, Mar 25, 2011 at 2:58 PM, Nicolas Petton <petton.nicolas@gmail.com> wrote: Le lundi 21 mars 2011 à 10:17 +0100, Richard Durr a écrit : > As far as I can see, the only way to call external Javascript is by > writing Javascript-Code directly into a method like so: > doSomethingWith: anObject > {'return SOMELIBRARY.doSomething(anObject); '} > > > is this correct?
No, you can call JS functions with: #basicPerform: and #basicPerform:withArguments:
Cheers, Nicolas
> The OMETA based Smalltalk->JS translator seem to let one use st-syntax > for direct access to javascript like so: > > > doSomethingWith: anObject [ > SOMELIBRARY doSomething: anObject. > ] > > > and CoffeeScript can use JS seamlessly in the same way. > > > Best regards, > RD > > On Mon, Mar 14, 2011 at 7:36 PM, Nicolas Petton > <petton.nicolas@gmail.com> wrote: > Hi, > > I would like to share a project I'm working on on my spare > time: Jtalk > Smalltalk. > > http://nicolaspetton.github.com/jtalk > https://github.com/NicolasPetton/jtalk > > Jtalk is an implementation of the Smalltalk language that > compiles into > JavaScript. > > Some features: > - it is written in itself (including the parser/compiler) > - it is self-contained > - it compiles into efficient JS code > - it uses the Squeak chunk format > - Pharo is considered as the reference implementation > > I think Jtalk can be compared to CoffeeScript[1], > Objective-J[2] or > Clamato[3], from which it reuses some ideas and code. > > Jtalk includes an IDE with a class browser, transcript and > workspace, an > HTML canvas similar to Seaside and a jQuery binding. > > It is still a young piece of code, and some important features > are still > missing/incomplete. > > Cheers, > Nicolas Petton > > [1] http://jashkenas.github.com/coffee-script/ > [2] http://cappuccino.org/ > [3] http://clamato.net > > > >
participants (13)
-
Alexandre Bergel -
Craig Latta -
Dave Mason -
Hannes Hirzel -
Hilaire Fernandes -
Janko Mivšek -
Mariano Martinez Peck -
Nicolas Petton -
Norbert Hartl -
Noury Bouraqadi -
Richard Durr -
Stéphane Ducasse -
Sven Van Caekenberghe