npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

littlesmallscript

v1.0.4

Published

A simple Smalltalk to js translator.

Downloads

10

Readme

Little Smallscript

Little Smalltalk to Javascript translator.

Author:

Minori Yamashita [email protected]

LICENCE:

MIT

INSTALLATION:

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

USAGE:

$ littlesmallscript --help

Direction:

  • The goal is to write Javascript in Smalltalk's syntax.
  • No class browser and stuff.
  • Some expressions are converted to javascripts syntax, for efficiency and readability.
    • "(1 === 1) ifTrue: ['yay']" -> "(1 === 1).ifTrue(function () {return 'yay';})" -> "(1 === 1) ? (function { 'yay'; })() : void 0;"
    • #(1 2 3) at: 0 -> [1,2,3].at(0) -> [1,2,3][0]
  • Other message expressions are translated into method calling expression.
    • "obj unary" becomes "obj.unary()". "array inject:1 into:[]" becomes "array.injectinto(1, function () {})".
    • binary messages take js operators as selectors: x % 2 === 0

ToDo:

  • Error messages enhancement
  • Bundle standard methods into compiled js (issue#3)
  • !!!DOCUMENTS!!!
  • ^ syntax

Example:

https://github.com/ympbyc/LittleSmallscript/tree/master/examples

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
crawl
  window alert: 'Slithering...'.
  self move: 5
!.
Snake new
; setName: 'Sammy the Python'
; crawl

Versions:

16::42 13 Oct 2012

v1.0.1 The last statement in a block can end with a tailing period.

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.