pcerman / mal

Implementation of the mal language in gambit scheme and C#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mal

This is implementation of the mal programming language. I have not merged it into original repository because csharp, cpp and scheme implementations are already there.

This repository contains four implementations: one is implemented in gambit scheme, second one in C# for dotnet core 3.1, third one is implemented in C++ and last one is implemented standard ML MLton. Last one is possible to compile it with PolyML compiler by using sml-buildscripts.

I have developed them on ubuntu mate linux version 20.04.

All implementations follows instructions in the "The Make-A-Lisp Process" guide but there are some differences from original:

csharp

  • integer and real numbers are implemented also with predicate and conversion functions.
  • key for hash-map can be string, keyword, symbol and integer number
  • quit function is implemented
  • symbols are unique - for every unique symbol name only one Symbol object is created

gambit

  • full numeric tower of the gambit language is used
  • key for hash-map can be string, keyword, symbol and integer number

C++

  • integer and real numbers are implemented also with predicate and conversion functions.
  • key for hash-map can be string, keyword, symbol and integer number
  • AVL tree is used for hashmap
  • simple stop-and-copy garbage collector is imlemented

polyml

  • integer and real numbers are implemented also with predicate and conversion functions.
  • key for hash-map can be string, keyword, symbol and integer number
  • AVL tree is used for hashmap

All implementations are trying to load .malrc file in the current directory when intepreter is started. There are symbolic links .malrc into ../lib/init.mal file in all four implementations.

Subfolder lib contains several mal libraries

  • defines.mal
    implements macros which simplify definitions to be more like clojure expressons
  • pairing-heap.mal
    implements pairing heap suitable for functional languages
  • queue.mal
    implements queue in functional style
  • utils.mal
    some usefull sequence functions
  • trace.mal
    definition of simple trace and untrace macros
  • init.mal
    Symbolic file system links .malrc are linked to this file in all four implementations. Therefor this file is loaded when interpreter is started.

License

This code is released under Mozilla Public License 2.0.

Copyright (c) 2019 Peter Cerman (https://github.com/pcerman)

About

Implementation of the mal language in gambit scheme and C#

License:Mozilla Public License 2.0


Languages

Language:C++ 34.5%Language:C# 32.1%Language:Standard ML 18.5%Language:Scheme 14.4%Language:Makefile 0.5%Language:Shell 0.0%