a multi-syntax language
A prototype of a multi-syntax programming language.
Hivemind has a core language defined by its AST and configurable syntaxes acting like plugins.
The concept of "syntax" for hivemind is similar to
Syntaxes are defined using code-like examples for core ast nodes and they act in a bidirectional way:
Tools for the language would also support representations of source grouped by class or methods or as a graph
Syntaxes look like that:
A pythonic syntax:
#if_statement
if <test>:
<true_branch>
else:
<else_branch>
#assign
<left> = <right>
#call
<function>(<<args:', '>>)
#attribute
<object>.<label>
#attribute_assign
<object>.<label> = <right>
#binary
<left> <operation> <right>
#list
[<<elements:', '>>]
#method_statement
method <method_name>(<<args:', '>>):
<<body>>
#class_statement
class <class_name>:
<<methods:''>>
#module_statement
module <module_name>:
<<elements>>
A lisp-like syntax
#if_statement
(if <test>
<true_branch>
<else_branch>)
#assign
(define <left> <right>)
#method_statement
(method <method_name> (<<args:' '>>)
<<body>>)
#attribute
<object>.<label>
#attribute_assign
(update <object>.<label> <right>)
#binary
(<operation> <left> <right>)
#call
(! <function> <<args:' '>>)
#list
_(<<elements:' '>>)
#class_statement
(class <class_name>
<<methods>>)
#module_statement
(module <module_name>
<<elements>>)
pythonic example schemelike example
gem install hivemind
Run a file
hivemind <filename>
Translate a file into another syntax representation
hivemind render a.hm pythonic a2.hm
The core language is just a simple python/ruby-like language for now.
Created for the HackFMI 5
Copyright 2016 Alexander Ivanov
Distributed under the MIT License.