Skip to content
/ mal Public

Implementation of the mal language in gambit scheme and C#

License

Notifications You must be signed in to change notification settings

pcerman/mal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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#

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published