A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ympbyc/LittleSmallscript below:

ympbyc/LittleSmallscript: JavaScript with Smalltalk's syntax

A dialect of Smalltalk that compiles into JavaScript.

Minori Yamashita ympbyc@gmail.com

MIT

$ git clone https://github.com/ympbyc/LittleSmallscript.git
$ cd LittleSmallscript
$ npm install -g

or simply

$ npm install -g littlesmallscript

Compile and run on node:

$ cat examples/server.st | littlesmallscript | node

Saving the compiled file:

$ cat examples/server.st | littlesmallscript > ~/server.js

etc

https://github.com/ympbyc/LittleSmallscript/tree/master/examples https://github.com/ympbyc/expensivecamera/blob/master/src/expensivecamera.st

The language is changing every second so do example codes. Here's what works at least for now.

+Object subclass:#Animal variables:#(#name).

!Animal setName: aName
  name := aName !.

!Animal move: metre
  window alert: name + ' moved ' + metre + 'm.' !.

+Animal subclass:#Snake variables:#().

!Snake move
  window alert:'Slithering...'.
  Snake super:#move arguments:#(5) !.

Snake new
; setName:'Sammy the Python'
; move

12:47 29 Jan 2013
v1.0.4
Inputs can now be piped-in to littlesmallscript. e.g: echo '(1 to: 5) map: [ :n | n * n]' | littlesmallscript.

12:35 2 Nov 2012
v1.0.3
String literals compile into single-quoted JS string. They were double quotes in previous versions. String literals support backslash escaping.

18:40 17 Oct 2012
v1.0.2
A temporary syntax for calling super methods is introduced. See the example above.

23:00 30 Sep 2012
v1.0.0
The first major version! Every parser is now written in LittleSmallscript itself. v1 is not backward compatible with v0. Syntax for accessing instance variables has changed. Class definition syntax has been added.

23:00 20 Sep 2012
v0.0.4
Fixed many bugs. Binary messages now take bare operators instead of primitives. method:at: and method:dot: fixes the scope of 'self'.

1am 20 Sep 2012
v0.0.3
Ready to ship! Known bugs are to be fixed. Added optimization.

12pm 12 Sep 2012
v0.0.2
Statement parser is coplete. Consequently, temporary variable declaration is now supported. | foo bar | compiles to var foo, bar;. Inline javascript as primary values. obj method: <function () {}> Binary messages with javascript operators. 1 <+> 1; Much of Little Smalltalk's built-in methods are provided via the library: prelude.js. Prettyprint using beautify.js.

5am 10 Sep 2012
v0.0.1
Implemented a PEG parser in javascript. Can now parse and generate expressions and literals. Messages are compiled to method calling, blocks are compiled to function literal. Temporary variable declaration is yet to be supported.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3