As some of you may know, I've been working on implementing Self in Javascript (in addition to some build system improvements), and I'd like to let the list know about the progress. Today I put together a little demo of what is currently working and a bit of a post on what is not:
http://blog.dloh.org/Self-in-Javascript-Video
The video is 720p so don't bother trying to watch it on your iPhone :)
It is not a fully functional system yet, it is about 40% of the way there, and the compiler will require a rewrite before it is ready for actual use. But the bones are there and for certain simple statements which invoke built-in functions you can make little things happen. The way this thing works currently is it parses a string into a set of tokens, and then translates them into a rather LISPish variant of standard JavaScript. If you look here:
https://github.com/cthulhuology/Self.js
you will see that I'm seriously abusing some little used features of the JavaScript language to make it do some rather interesting backflips. In effect, the entire program consists of lists of strings passed to a self evaluating function object. This makes it possible to generate a rather simple transformation engine which rewrites the self code into a highly regular form of Javascript that is devoid of the syntatic complexity of its language family.
The current code base is ~206 lines of JavaScript, and once you work through how it works in your head, it is surprisingly legible.
If anyone would like to comment, contribute, or recommend some better parser techniques for the full self syntax, I'd appreciate the guidance. Mostly I am working through a set of test cases I extracted by looking at my own Self objects and bits of the system. I'm not too concerned about being 100% compliant at the moment, but simply want to trend towards completeness.
Dave Goehrig
Awesome!
Do you have any interest in integrating this with Avocado? (http://avocadojs.com - it's a Self-like environment I've been building for JavaScript.)
I've been sticking with standard JavaScript syntax so far, but I think it'd be really cool (and maybe make me feel a bit less homesick ;) if I could write real Self code inside Self-like outliners running on top of my web browser's Self-inspired JavaScript VM.
Adam
--- In self-interest@yahoogroups.com, David Goehrig <dave@...> wrote:
As some of you may know, I've been working on implementing Self in Javascript (in addition to some build system improvements), and I'd like to let the list know about the progress. Today I put together a little demo of what is currently working and a bit of a post on what is not:
http://blog.dloh.org/Self-in-Javascript-Video
The video is 720p so don't bother trying to watch it on your iPhone :)
It is not a fully functional system yet, it is about 40% of the way there, and the compiler will require a rewrite before it is ready for actual use. But the bones are there and for certain simple statements which invoke built-in functions you can make little things happen. The way this thing works currently is it parses a string into a set of tokens, and then translates them into a rather LISPish variant of standard JavaScript. If you look here:
https://github.com/cthulhuology/Self.js
you will see that I'm seriously abusing some little used features of the JavaScript language to make it do some rather interesting backflips. In effect, the entire program consists of lists of strings passed to a self evaluating function object. This makes it possible to generate a rather simple transformation engine which rewrites the self code into a highly regular form of Javascript that is devoid of the syntatic complexity of its language family.
The current code base is ~206 lines of JavaScript, and once you work through how it works in your head, it is surprisingly legible.
If anyone would like to comment, contribute, or recommend some better parser techniques for the full self syntax, I'd appreciate the guidance. Mostly I am working through a set of test cases I extracted by looking at my own Self objects and bits of the system. I'm not too concerned about being 100% compliant at the moment, but simply want to trend towards completeness.
Dave Goehrig
-- -=-=-=-=-=-=-=-=-=-=- http://blog.dloh.org/
Have either of you looked at PetitParser or OMeta? They might make managing your grammar and semantics a bit cleaner.
On Mon, Jul 11, 2011 at 7:30 PM, Adam adam.spitz@gmail.com wrote:
**
Awesome!
Do you have any interest in integrating this with Avocado? ( http://avocadojs.com - it's a Self-like environment I've been building for JavaScript.)
I've been sticking with standard JavaScript syntax so far, but I think it'd be really cool (and maybe make me feel a bit less homesick ;) if I could write real Self code inside Self-like outliners running on top of my web browser's Self-inspired JavaScript VM.
Adam
--- In self-interest@yahoogroups.com, David Goehrig <dave@...> wrote:
As some of you may know, I've been working on implementing Self in Javascript (in addition to some build system improvements), and I'd like
to
let the list know about the progress. Today I put together a little demo
of
what is currently working and a bit of a post on what is not:
http://blog.dloh.org/Self-in-Javascript-Video
The video is 720p so don't bother trying to watch it on your iPhone :)
It is not a fully functional system yet, it is about 40% of the way
there,
and the compiler will require a rewrite before it is ready for actual
use.
But the bones are there and for certain simple statements which invoke built-in functions you can make little things happen. The way this thing works currently is it parses a string into a set of tokens, and then translates them into a rather LISPish variant of standard JavaScript. If you look here:
https://github.com/cthulhuology/Self.js
you will see that I'm seriously abusing some little used features of the JavaScript language to make it do some rather interesting backflips. In effect, the entire program consists of lists of strings passed to a self evaluating function object. This makes it possible to generate a rather simple transformation engine which rewrites the self code into a highly regular form of Javascript that is devoid of the syntatic complexity of
its
language family.
The current code base is ~206 lines of JavaScript, and once you work
through
how it works in your head, it is surprisingly legible.
If anyone would like to comment, contribute, or recommend some better
parser
techniques for the full self syntax, I'd appreciate the guidance. Mostly
I
am working through a set of test cases I extracted by looking at my own
Self
objects and bits of the system. I'm not too concerned about being 100% compliant at the moment, but simply want to trend towards completeness.
Dave Goehrig
-- -=-=-=-=-=-=-=-=-=-=- http://blog.dloh.org/
Yes I have, but Ometa is a horrific environment for actually defining a program in. The problem is that writing the grammar and necessary productions is harder than writing a special case parser. Additionally, I am not willing to maintain any project which would require far more code than doing it from scratch would.
On Jul 11, 2011, at 8:37 PM, Casey Ransberger casey.obrien.r@gmail.com wrote:
Have either of you looked at PetitParser or OMeta? They might make managing your grammar and semantics a bit cleaner.
On Mon, Jul 11, 2011 at 7:30 PM, Adam adam.spitz@gmail.com wrote:
Awesome!
Do you have any interest in integrating this with Avocado? (http://avocadojs.com - it's a Self-like environment I've been building for JavaScript.)
I've been sticking with standard JavaScript syntax so far, but I think it'd be really cool (and maybe make me feel a bit less homesick ;) if I could write real Self code inside Self-like outliners running on top of my web browser's Self-inspired JavaScript VM.
Adam
--- In self-interest@yahoogroups.com, David Goehrig <dave@...> wrote:
As some of you may know, I've been working on implementing Self in Javascript (in addition to some build system improvements), and I'd like to let the list know about the progress. Today I put together a little demo of what is currently working and a bit of a post on what is not:
http://blog.dloh.org/Self-in-Javascript-Video
The video is 720p so don't bother trying to watch it on your iPhone :)
It is not a fully functional system yet, it is about 40% of the way there, and the compiler will require a rewrite before it is ready for actual use. But the bones are there and for certain simple statements which invoke built-in functions you can make little things happen. The way this thing works currently is it parses a string into a set of tokens, and then translates them into a rather LISPish variant of standard JavaScript. If you look here:
https://github.com/cthulhuology/Self.js
you will see that I'm seriously abusing some little used features of the JavaScript language to make it do some rather interesting backflips. In effect, the entire program consists of lists of strings passed to a self evaluating function object. This makes it possible to generate a rather simple transformation engine which rewrites the self code into a highly regular form of Javascript that is devoid of the syntatic complexity of its language family.
The current code base is ~206 lines of JavaScript, and once you work through how it works in your head, it is surprisingly legible.
If anyone would like to comment, contribute, or recommend some better parser techniques for the full self syntax, I'd appreciate the guidance. Mostly I am working through a set of test cases I extracted by looking at my own Self objects and bits of the system. I'm not too concerned about being 100% compliant at the moment, but simply want to trend towards completeness.
Dave Goehrig
-- -=-=-=-=-=-=-=-=-=-=- http://blog.dloh.org/
-- Casey Ransberger
Not really :) I already have a js programming environment in my phos interface. I don't really feel like porting on to of LK. I will probably reuse my canvas/hid abstraction layer but replicate the GUI in straight HTML first.
I am interested in pushing into webgl and 3d interfaces though.
But I have a self imposed 1kloc limit on the total code base :)
-=-=- dave@nexttolast.com -=-=-
On Jul 11, 2011, at 7:30 PM, "Adam" adam.spitz@gmail.com wrote:
Awesome!
Do you have any interest in integrating this with Avocado? (http://avocadojs.com - it's a Self-like environment I've been building for JavaScript.)
I've been sticking with standard JavaScript syntax so far, but I think it'd be really cool (and maybe make me feel a bit less homesick ;) if I could write real Self code inside Self-like outliners running on top of my web browser's Self-inspired JavaScript VM.
Adam
--- In self-interest@yahoogroups.com, David Goehrig <dave@...> wrote:
As some of you may know, I've been working on implementing Self in Javascript (in addition to some build system improvements), and I'd like to let the list know about the progress. Today I put together a little demo of what is currently working and a bit of a post on what is not:
http://blog.dloh.org/Self-in-Javascript-Video
The video is 720p so don't bother trying to watch it on your iPhone :)
It is not a fully functional system yet, it is about 40% of the way there, and the compiler will require a rewrite before it is ready for actual use. But the bones are there and for certain simple statements which invoke built-in functions you can make little things happen. The way this thing works currently is it parses a string into a set of tokens, and then translates them into a rather LISPish variant of standard JavaScript. If you look here:
https://github.com/cthulhuology/Self.js
you will see that I'm seriously abusing some little used features of the JavaScript language to make it do some rather interesting backflips. In effect, the entire program consists of lists of strings passed to a self evaluating function object. This makes it possible to generate a rather simple transformation engine which rewrites the self code into a highly regular form of Javascript that is devoid of the syntatic complexity of its language family.
The current code base is ~206 lines of JavaScript, and once you work through how it works in your head, it is surprisingly legible.
If anyone would like to comment, contribute, or recommend some better parser techniques for the full self syntax, I'd appreciate the guidance. Mostly I am working through a set of test cases I extracted by looking at my own Self objects and bits of the system. I'm not too concerned about being 100% compliant at the moment, but simply want to trend towards completeness.
Dave Goehrig
-- -=-=-=-=-=-=-=-=-=-=- http://blog.dloh.org/
self-interest@lists.selflanguage.org