Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What hash/map based programming language exist?

Much like lisp is often considered a list based programming language what languages are considered map based?

I remember reading about one a few years back, but can not longer find a reference to it. It looked something like:

[if:test then:<code> else:<more code>]

edit: and more where quoted code blocks which would be conditional evaluated. In this fashion if/cond and others would not be special form as they are in lisp/scheme.

The syntax above is supposed to be map/dictionary like just like lisp's syntax is list like.

if would be a key with the value of test.

then would be a key with the value of .

...

like image 544
Davorak Avatar asked Jun 23 '26 10:06

Davorak


2 Answers

That looks very much like MISC, a lazy Lisp with maps instead of lists as the fundamental datatype. (It's also lazy, has deep integration of metadata (similar to Clojure) and a couple of other things, but it is still very much a Lisp: functional, homoiconic, macros, implemented as a metacircular interpreter, all the good stuff.)

Here's some code samples from the blog:

[if [> 5 10] then:[+ 5 10] else:[- 5 10]]

[let '[square:[lambda '[x:1] '[* x x]]]
    '[square 12]
]

[take 20 [numbers from:0]]

Unfortunately, it seems that besides two blog articles from long ago, there's not much going on anymore.

like image 173
Jörg W Mittag Avatar answered Jun 27 '26 23:06

Jörg W Mittag


I'd suggest Lua too. The whole language is based around tables - objects are tables, their definitions are tables, variables are in tables, tables define scope, etc etc - where a table is a hashmap.

like image 23
Puppy Avatar answered Jun 27 '26 23:06

Puppy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!