Angel \”Java\” Lopez on Blog

July 19, 2014

SharpGo Implementing Go in C# (1) The Project

Filed under: .NET, C Sharp, Go, Google, Open Source Projects, Programming Languages, SharpGo — ajlopez @ 5:06 pm

There is another project of mine to practice TDD (Test-Driven Development) and C#, at:

https://github.com/ajlopez/SharpGo

It is an interpreter (not a compiler) of Go programming language, written in C#. It has a class library project, and a test project. Go is a typed language, so I cannot follow the path of build an expression tree, and evaluate it, as in RubySharp, PythonSharp and Mass. Instead, the interpreter should have many phases, as in ScalaSharp, to detect type inconsistencies, and use the declaration of unknown types at the parse process.

The AST is implemented:

The AST (Abstract Syntax Tree) nodes are in two groups:

– Command Nodes, where they should generate commands to be executed.

– Expression Nodes, that generates expressions to be evaluated. They have an associated type.

The commands declare variables with types. By now, I have all in place to start:

– Declare the types of some declarations of variables and functions
– Control that types are the right ones, ie, an integer variable should not be assigned to an string expression
– Start to emit commands and expression

As in other projects, I want to add access to native .NET types, libraries and objects. I should research how many features of Go I could implement in this approarch. An example: the implementation of Go structures, and their original semantic in C#. I could implement channels (years ago, I implemented channels in C# and AjSharp).

Stay tuned!

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

June 20, 2014

End Of Iteration 2014w24

Filed under: .NET, C Sharp, Iteration, Mass, Open Source Projects, SharpBus, SharpGo, SharpMongo — ajlopez @ 6:27 pm

Previous Post
Next Post

SharpGo

My Go Programming Language interpreter in C#

https://github.com/ajlopez/SharpGo

I added typed nodes to Abstract Syntax Tree, and nodes that generate expressions instead of commands. The types will help me to determine if an expression is valid or not, according to Go type specifications.

Mass

The Mass programming language interpreter

https://github.com/ajlopez/Mass

I reimplemented binary arithmetic operations (and string concatenation) without using ObOps, but directly using compiled lambda expressions. Next steps: removing ObOps dependency from compare operations. I think that a compiled lambda is a better outcome for such expression.

SharpMongo

My in-process, in-memory implementation in C# of a document database with a MongoDB-like interface:

https://github.com/ajlopez/SharpMongo

I fixed source analysis issuses, and added .count method to collections and to collection objects in REPL.

SharpBus

I started

https://github.com/ajlopez/SharpBus

A simple message bus implemented in C#, inspired by Mule. Notably, the flow of message can be defined using lambdas (something missing in Mule Java up to version 7). Using TDD, using fluent interface, consuming lamdbas, is the simplest way I found to implement a message bus.

Others

I worked fixing scripts in https://github.com/ajlopez/ajlopezsite. My parser “generator” https://github.com/ajlopez/GrammGen was  converted to VisualStudio 2010I worked on four non-public projects. More fun is coming.

Stay tuned!

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

May 21, 2014

End Of Iteration 2014w20

Filed under: C Sharp, ClojSharp, Iteration, JavaScript, NodeJs, Open Source Projects, SharpGo — ajlopez @ 10:58 am

Previous Post
Next Post

SharpGo

Go programming language interpreter in C#:

https://github.com/ajlopez/SharpGo

I added comparison operators in lexer, parse binary expression using arithmetic and comparison operators, add statements separated by semicolons, parse blocks, parse assignment. Go is a type language, so I’m building the Abstract Syntax Tree of to-be-typed nodes, before evaluating the expressions as in an untyped interpreter.

SimpleScraper

Simple HTML scraper, implemented in plain JavaScript, without dependencies:

https://github.com/ajlopez/SimpleScraper

It runs on Node.js, but it could run from browser. I improved the sample use cases, scraping two popular Argentinean news sites. The samples get an article or a frontpage, and produce JSON output.

ClojSharp

Clojure interpreter in C#:

https://github.com/ajlopez/ClojSharp

This week I added multi-functions: functions defined with different bodies according to arity (no argument, one argument, two arguments and rest, etc..) I started to add support for anonymous function macro reader

Others

A minor refactor in https://github.com/ajlopez/AcquarellaJS my syntax highlighter in JavaScript, work in progress. I added some simple samples to https://github.com/ajlopez/ScalaSamples. I started to support the add of named nodes to compiler context in https://github.com/ajlopez/ScalaSharp. I also worked on three non-public projects. More fun is coming.

Keep tuned!

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

Create a free website or blog at WordPress.com.