All Projects → guofei → Flang

guofei / Flang

Licence: MIT license
A Scheme dialect

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Flang

quickjs-build
Build for QuickJS JavaScript Engine
Stars: ✭ 25 (-3.85%)
Mutual labels:  interpreter
cidk
interpreter devkit
Stars: ✭ 23 (-11.54%)
Mutual labels:  interpreter
clri
An unfinished CIL interpreter in Rust
Stars: ✭ 22 (-15.38%)
Mutual labels:  interpreter
PDDL.jl
Julia parser, interpreter and compiler interface for the Planning Domain Definition Language (PDDL). Planners not included.
Stars: ✭ 52 (+100%)
Mutual labels:  interpreter
blade
A simple, fast, clean, and dynamic language that allows you to develop applications quickly.
Stars: ✭ 113 (+334.62%)
Mutual labels:  interpreter
basicv2
A Commodore (CBM) BASIC V2 interpreter/compiler written in Java
Stars: ✭ 73 (+180.77%)
Mutual labels:  interpreter
pyccolo
Declarative instrumentation for Python.
Stars: ✭ 70 (+169.23%)
Mutual labels:  interpreter
gpp
General PreProcessor
Stars: ✭ 25 (-3.85%)
Mutual labels:  interpreter
webasm-solidity
[DEPRECATED] On-chain interpreter for WebAssembly written in Solidity
Stars: ✭ 65 (+150%)
Mutual labels:  interpreter
riptide
The Riptide Programming Language: Shell scripting redesigned.
Stars: ✭ 24 (-7.69%)
Mutual labels:  interpreter
slox
Swift implementation of a Lox interpreter
Stars: ✭ 39 (+50%)
Mutual labels:  interpreter
AlchemyVM
WebAssembly Virtual Machine Built In Elixir
Stars: ✭ 184 (+607.69%)
Mutual labels:  interpreter
SOMns
SOMns: A Newspeak for Concurrency Research
Stars: ✭ 62 (+138.46%)
Mutual labels:  interpreter
locks-py
Python implementation of locks, which is an imperative, dynamically typed, procedure oriented scripting language based on the lox programming language.
Stars: ✭ 29 (+11.54%)
Mutual labels:  interpreter
fint
.NET CIL interpreter written in simple subset of F#
Stars: ✭ 50 (+92.31%)
Mutual labels:  interpreter
jsish
Jsi is a small, C-embeddable javascript interpreter with tightly woven Web and DB support.
Stars: ✭ 32 (+23.08%)
Mutual labels:  interpreter
uwuscript
World's first uwu-oriented language.
Stars: ✭ 75 (+188.46%)
Mutual labels:  interpreter
rust lisp
A Rust-embeddable Lisp, with support for interop with native Rust functions
Stars: ✭ 128 (+392.31%)
Mutual labels:  interpreter
forthscript
Forthscript programming language interpreter
Stars: ✭ 16 (-38.46%)
Mutual labels:  interpreter
xemime
The Xemime programming language
Stars: ✭ 13 (-50%)
Mutual labels:  interpreter

Flang

A Scheme dialect written in Golang

Concept

The eval-apply cycle

Hello World

(p "hello world")
"hello world"

Basic types

Number, Symbol, String, Boolean, Lambda, List, Pair

Number

(+ 1 2)
3
(- 10 2)
8
(* 1.5 2)
3

String

Example

(string? "hello world")
#t

Boolean

Example

(eq? 1 1)
#t
(eq? 1 2)
#f

Lambda

Example

((lambda (x) (* x x)) 2)
4

List

Example

(list? (list 1 2 3))
#t

Pair

Example

(pair? (cons 1 2))
#t

Definition

Define a varable

(define <var> <value>)

Example

(define x 1)

Define a function

(define (<var> <param1> ... <paramN>) <value>)

Example

(define (factorial n)
  (if (eq? n 1)
      1
      (* (factorial (- n 1)) n)))
(factorial 5)

;; result: 120

Assignment

(set! <var> <value>)

Example

(define x 1)
(set! x 10)
(p x)

;; result: 10

Conditions

if, cond

Example

(define x 1)
(if (> x 5) 
    (p "greater than 5")
    (p "less than 5"))

Function

Lambda

((lambda (x) (* x x)) 2)
4

Standard Library

cons, car, cdr, list, pair ...

TODOS

  • REPL
  • Macro
  • Comment
  • Go Channel
  • Bootstrapping
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].