July 1, 2026

Capitalizations Index – B ∞/21M

an Smart Contract Programming Language for Ethereum: Introduction

an Smart Contract Programming Language for Ethereum: Introduction

After writing gelex (generic lexer), geast (generic Abstract Syntax Tree) and gepars (generic parser), using JavaScript as implementation language, I started to use these projects to design and build a simple programming language compiler: selang. As usual, I’m using TDD (Test-Driven Development) as code workflow. It helps me to follow KISS (keep-it-simple-stuped), baby steps, and emergent design.

The target of compilation is the Ethereum Virtual Machine. The process of compilation is:

Current implementation is still incomplete, but a sample with code, compilation, deploy and invocation is here.

The code of the simple contract is

contract Counter 

public void increment()

public void add(uint value)
}

You can compile the code with

node compile

And you can compile, deploy to http://localhost:8545 (usually a ganache-cli node instance), and invoke it, executing:

node deploy

The only type supported is uint (unsigned 32 bytes integer). Next steps:

  • Support for other numeric types
  • Support for static and dynamic arrays (a bit challenging, memory management with bytecodes)
  • Support for strings (another challenge: using keccak256 hash functions to allocate dynamically the string in 32-bytes storage cells)
  • Constructor code (it’s code that is used only once, and should be compiled in different ways)
  • Inheritance

Related posts:

Angel “Java” Lopez
https://github.com/ajlopez
https://twitter.com/ajlopez

Published at Tue, 21 May 2019 15:21:17 +0000

Previous Article

Watch 10 Essential Talks from Ethereal Summit NY 2019

Next Article

Boeing Bounces After Kamikaze Bird Rumor Bolsters Key Dow Stock

You might be interested in …

#206 karl kreder: grid+ – unlocking direct access to wholesale energy markets

#206 Karl Kreder: Grid+ – Unlocking Direct Access to Wholesale Energy Markets

#206 Karl Kreder: Grid+ – Unlocking Direct Access to Wholesale Energy Markets Support the show, consider donating: BTC: 1CD83r9EzFinDNWwmRW4ssgCbhsM5bxXwg (https://epicenter.tv/tipbtc) ETH: 0x8cdb49ca5103Ce06717C4daBBFD4857183f50935 (https://epicenter.tv/tipeth) Energy markets form a complex ecosystem of actors. Wholesale energy producers create […]

Comsa - 実ビジネスのブロックチェーン技術導入を支援するicoソリューション

COMSA – 実ビジネスのブロックチェーン技術導入を支援するICOソリューション

COMSA – 実ビジネスのブロックチェーン技術導入を支援するICOソリューション COMSA – 実ビジネスのブロックチェーン技術導入を支援するICOソリューション トークンセールは2017年10月2日から11月6日まで開催。 詳しくは公式ウェブサイトへ: http://comsa.io/ 英語版の動画はこちら: https://www.youtube.com/watch?v=cmXWU9Ufe-4