Category Archives: AjTalk

New Month’s Resolutions: May 2017

There is a new month, time to write the new resolutions. First, a review of the previous ones:

– Continue RskSharp [complete] see repo
– Continue SimpleBlockchain [complete] see repo
– Continue Solidity Compiler [pending]
– Continue ChineseP [complete] see repo
– Continue TensorSharp [complete] see repo
– Continue RSharp [complete] see repo
– Continue SimpleForth [pending]

Additionally, I was working on:

– Continue BlockchainSharp [complete] see repo
– Start Neurum, neural networks in C# [complete] see repo
– Improve AjTalkJS, Smalltalk interpreter in JavaScript [complete] see repo
– Improve SimpleProlog, Prolog interpreter in JavaScript [complete] see repo
– Improve AjDrawJS [complete] see repo

New month’s resolutions:

– Continue RskSharp
– Continue SimpleBlockchain
– Continue BlockchainSharp
– Continue ChineseP
– Continue TensorSharp
– Continue RSharp

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

New Month’s Resolutions: November 2014

Time to review past month’s resolutions:

– Give a talk Aktores intro [complete] see repo see presentation
– Distributed AjErl [pending]
– More Express samples in AjTalkJs [complete] see repo
– Explore neural networks in JavaScript [complete] see repo
– Explore genetic algorithms in JavaScript [partial] see repo
– Explore other artificial intelligence topics in JavaScript [partial]
– More Distributed Aktores [pending]
– Start Distributed Smalltalk in AjTalkJs [complete] see repo

My new month’s resolutions:

– Give a talk about JavaScript and Artificial Intelligence
– Neural network in JavaScript example
– Genetic Algorithms in JavaScript example
– More Code Generation using AjGenesis for NodeJs
– Basic Script Language for C#
– Improve SimpleScript for JavaScript

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

AjTalk Implementing Smalltalk In C# (4) The Project

Previous Post

Year and a half since I didn’t write about this project in C #, but I was working on it, and the parallel implementation I have in JavaScript (in fact, I introduced some concepts of both the Smalltalks 2013 conference, Rosario, Argentina).

The project is at:

https://github.com/ajlopez/AjTalk

Current structure:

The projects are:

AjTalk: class library, with a compiler to bytecodes implementation. There is a compiler to JavaScript too. There is an interpreter of those bytecodes.

AjTalk.Compiler: a console project that uses the compiler to JavaScript.

AjTalk.Console: a simple REPL (Read Eval Print Loop)

AjTalk.Gui: a work-in-progress example using windows

AjTalk.Tests: the test I wrote, followin TDD (Test-Driven Development) flow.

I guess now I don’t need the compiler to JavaScript, because I have a native JavaScript implementation at:

https://github.com/ajlopez/AjTalkJs

It can compile to bytecodes or to JavaScript. The project is written in JavaScript.

The window implementation is very primitive. I plan to replace it for direct AjTalk program using .NET types and object.

One point that I find very interesting (in both projects, C # and JavaScript) is to have a modular implementation: instead of loading an image yet defined, my plan is to define modules to load, as happens in the Node.js environment . The modules would be published in the NPM (Node Package Manager’s), and each could indicate which modules need in your program instead of lifting all Smalltalk.

Another topic in this C # project I have implemented that can run more than one AjTalk machine at the same time. And I can even make a machine “help” to the other. For example, if the machine does not have to compile methods to new methods, machine B can go to his aid. Thus, A machine (and his image, I’m already recording binary image) can be kept small.

Another feature that I have implemented: the ability to send a message to an object, without waiting for a response, a “fire and forget”. And that the target object can attend ONE OF those messages as models of actors.

I have to review the implementation of remote objects (now based on the old Remoting. NET). But I think it is an important feature to maintain and explore.

Well, you see, many issues remain for other posts, such as implementation details Smalltalk concepts such as Object, Class, ClassDescription, Behavior, MetaClass, etc..

Nos leemos!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

Smalltalk from Scratch

I think Smalltalk is a wonderful technology that influence the past decades in programming. But not directly: its influence is not via its killer apps. Smalltalk influenced programmers. The Smalltalk mark can be traced in Python and Ruby design decisions. And many programmers have been touched by Smalltalk ideas. But Smalltalk, as technology, didn’t exploded. We can discuss the reasons: early “balkanization” of providers, no early open source implementation. My thoughts: it is too couple to its own “GUI IDE”, and it is a bit overwhelming (too many pieces).

I think that is time to explore alternatives path. In the past decades, I visited many technologies and languages, and in the past ten (more or less) years, I took again Smalltalk and tried to follow an alternative path.

My position: we should try a simpler Smalltalk. An Smalltalk not tied to GUI IDE, not tied to thousands of classes. A simple implementation that can access the rest of the world advances in programming.

So, I started three own implementations: Smalltalk hosted in .NET, in Java and in JavaScript/Node.js:

https://github.com/ajlopez/AjTalk
https://github.com/ajlopez/AjTalkJava
https://github.com/ajlopez/AjTalkJs

More info in https://ajlopez.wordpress.com/category/smalltalk/.

But this post is not dedicated to review those implementation. Its purpose is to write down some ideas about how to create an Smalltalk, without struggling with the shrinking of a previous image.

The Core

I think that a new Smalltalk from scratch could be developed. An Smalltalk that runs in a host environment, like .NET, Java or JavaScript. Or another one. But it’s time to have an Smalltalk that is not an autism program: it should leverage the work of other technologies. For example, an Smalltalk running on JavaScript could access the JS ecosystem, via browser modules and libraries, or using Node.js or other engine package ecosystem.

The core Smalltalk should implement:

Object: the base object and class, with some base methods, like #subclass:.

Array: for arrays with numeric index, starting from 1 (to not break with Smalltalk tradition)

Dictionary: to map keys (names) to values

Primitive types: the underlying language (.NET, Java, JavaScript) could implement numbers (integers and floats), bytes, chars, strings, etc.

Access to native objects and types: to create them, to call type methods, to call instance methods.

The Library

First, a minimal implementation of some classes, that can be shipped with the initial implementation.

But then, and this is important: try to live in an ecosystem of packages. Instead of having all classes in the image, try to have an ecosystem of packages. Each Smalltalk application could define the needed packages, and then, the packages could be installed from the package ecosystem. In my implementations, I started to explore the use of NPM (Node Package Manager) to publish new package, and to install them per application, even with the use of explicit package version, so we have a less brittle ecosystem.

Package candidates:

– Test library (with an initial assert method)
– HTTP server
– MVC web framework (I have a minimal sample using Node.js Express)
– Distributed messages (I have a naive implementation in C#)
– etc.

In this way, the adoption of a package will be easy: not need of porting a package, only consume it, given the right dependencies in place. And, as in other technologies (Python, Ruby with gems, and notably, Node.js with NPM), each package can keep the description of the needed dependencies (NPM takes care of versions too).

Additional Items

I want to have an environment feature: that a class/package can load other classes, but only for internal use, without pollute the global Smalltalk environment.

I want to have an image running with the help of other image. That is, the Smalltalk VM should manage MORE THAN one running image. And one image could help another one. For example: one minimal image could have no compile method, but this method could be provided by the host image. In this way, a minimal image could be created, without any convoluted “shrinking” step. I already implemented this feature in my C# implementation.

In some implementations, I want to have an image (save and restore). But it is time to explore the development without the need of an image.

Any GUI should be created over the host environment. Use Windows.Form if your Smalltalk is running over C#. Or use another library, in Java (Swing? SWT?). But the idea is that the GUI management should be something clearly separated from the core implementation. Current popular Smalltalk implementations are too coupled with GUI management. Look at other technologies: Python, Ruby, Node.js, Go, etc.. There are lots of developers not using a technology so tied to a GUI IDE. And they are producing useful applications.

As I usually say: explore. That is the verb. We must explore alternative path, even when the outcome and gains are not clear. If I had seen killer applications in Smalltalk, or the use of Smalltalk in the creation of application that are really used by other developers (like in Python, Ruby, Java, JavaScript, Node.js, and others), I should stop thinking in this way. But, for some reason, Smalltalk is not taking the world by storm. Alternatives are here, floating around us, ready to be taken and to be explored.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

Smalltalk, JavaScript, NodeJs, C#, and Tutti Li Fiocci

Past year, I gave a talk at Smalltalks 2013, Rosario, Argentina. The conference was a great experience to me, and there were many interesting talks, implementations and ideas.

My talk was about implementing Smalltalk, in C#, and JavaScript. The main repos are:

http://github.com/ajlopez/AjTalk (I presented it at Smalltalks 2010)
https://github.com/ajlopez/AjTalkJs (I presented it at Smalltalks 2011)

My recorded talk:

http://www.youtube.com/watch?v=-KFjSneVE2s

The presentation:

https://github.com/ajlopez/Talks/tree/master/Smalltalks2013
http://ajlopez.github.io/Talks/Smalltalks2013/index.html
More talks at http://ajlopez.github.io/Talks/

The first project is an interpreted based on byte codes, written in C#. It can compile to JavaScript, but the key features is to have a VM based on bytecodes, that have access to native .NET types and objects, remote execution, actors, and more. See my posts.

The second project is an implementation of Smalltalk but in JavaScript. Internally, it have a compiler to JavaScript, but also a compiler to bytecodes and then, an interpreted VM written in JavaScript. Both projects now supports NPM (Node.js package manager) for new modules.

In 2013, I added Node.js support and access to AjTalkJs, so I can run an Express application from Smalltalk:

 

Next experiments: distributed message. That is, an object in one machine sends a message to an object in a remote machine/process,  in a fire and forget way. I think Node.js ecosystem is a good plate to host such experiments. My previous work at Distributed Applications with Node.js. I want a distributed Smalltalk machine/application. Maybe, if the communication protocol is easy or pluggable, I could add clients/servers implemented in other Smalltalk dialects. But baby steps first 😉

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

End Of Iteration 2013w44

Previous Post
Next Post

The main outcomes were: a talk, about my Smalltalk implementations, new sample code and a new project, inspired by Python and Smalltalk conference.

AjTalk Implementations

I reviewed and improved my implementations:

https://github.com/ajlopez/AjTalkJs
https://github.com/ajlopez/AjTalk

I added a sample using AjTalkJs, Node.js, Express.

My talk for Smalltalks 2013 at

https://github.com/ajlopez/Talks/tree/master/Smalltalks2013

RedPython

I want to implement a compiler/transpiler from reduced (subset of) Python to C, at first using JavaScript.

The project:

I have two samples running: simple hello world, and primes.py

https://github.com/ajlopez/RedPython

More ideas to implement this week. I should improve my Ruby in C# implementation, and maybe, write a Ruby implementation in JavaScript.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

New Month’s Resolutions: November 2013

Time to review my October resolutions:

– Give a talk about PHP and Node.js [complete] see post and PHP/Node repo and PageJs repo at PHP Dev Argentina 2013
– Give a talk about TDD with ASP.NET MVC [complete] see repo
– Give a talk about Scala implementation [complete] see slides and simple samples
– Give a talk about Python in JavaScript [complete] see repo and slides at PyCon 2013 Argentina
– Give a talk about Smalltalk in JavaScript and C# [complete] see repo and slides at Smalltalks 2013

This new month’s resolution:

– Start compiler reduced Python to C, using JavaScript
– Give a talk about Ruby in C#
– Start Ruby to JavaScript compiler
– Complete variable scope in Mass language
– Give a talk about compiling languages to JavaScript (to be confirmed)
– Write web framework for AjTalkJs (to be used in Node.js) (plain? MVC?)
– Improve NPM modules in AjTalkJs and AjTalk
– Improve unit test support in AjTalkjs and AjTalk
– Improve match and data structure in AjErl

More fun is coming 😉

Keep tuned!

Angel “Java” Lopez
@ajlopez

End Of Iteration 2013w43

Previous Post
Next Post

The week was dedicated to prepare and give a talk, and prepare this week next talk.

JPyScript

My Python to JavaScript transpiler, written using JavaScript. It runs on node.js and browser.

https://github.com/ajlopez/JPyScript

It can use Node.js modules using import, and it can run Python scripts in the browser.

I gave a talk at PyCon Argentina 2013. My slides at:

https://github.com/ajlopez/Talks/tree/master/PythonJavaScript

AjTalkJs

My Smalltalk-like VM in bytecodes and JavaScript, written in JavaScript.

https://github.com/ajlopez/AjTalkJs

Now, I can use Node.js modules, run in server and browser. Example:

I was working in minor refactoring of:

https://github.com/ajlopez/RubySharp
https://github.com/ajlopez/PythonSharp

And I was working on two non-public projects: one in C#, in-memory OLAP, and another one in Java, with agile team.

This week I will give a talk about my Smalltalk implementations at Smalltalks 2013 Argentina:

http://www.fast.org.ar/smalltalks2013

More fun is coming.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

End Of Iteration 2013w42

Previous Post
Next Post

The past week was dedicated to two non-public projects, and prepare of my next talks.

SimpleBeams

Inspired by a work by @darachennis  (https://github.com/darach/beam-js) I wrote a simpler implementation of beams (piped message processors

https://github.com/ajlopez/SimpleBeams

I should write the README.md, but the tests are self-explanatory. A beam receives messages and emit messages. It can have a filter function, filtering the message to process. And a transform function, that can emits new messages.

JPyScript

It compiles a Python-like language to JavaScript. The compiler is written in JavaScript

https://github.com/ajlopez/JPyScript

Notable, I can write controllers in Python for Express web apps. See samples

AjTalkJs

My Smalltalk VM in JavaScript. Using JavaScript, it compiles Smalltalk fileouts to bytecodes. It started to compile directly to JavaScript code, instead of only bytecodes.

https://github.com/ajlopez/AjTalkJs

It can run from Node.js, and from the browser, too.

I worked on two non-public projects, one using C# with Visual Studio 2010, and other using Java, with Maven, Eclipse, JBoss 5.x

This week I will give a talk at Python Argentina 2013 http://ar.pycon.org/

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez