User loginNavigation 
Prototyping a new language with HaskellHi all! I'm prototyping a new language with Haskell. Once I get the semantics right, I'll probably implement it more efficiently with straight C++ and LLVM. I hope to have something interactive soon. Here's the overview  Luna is intended to expose functional, objectoriented, and most importantly, 'languageoriented' programming paradigms in one simple and machineefficient language. It has optional dynamic binding. The 'language orientation' paradigm is what makes the optional dynamic binding so important. Luna is general purpose. It has two syntaxes  sexp and meta, with the latter being used by default and being translated to sexp for macro processing. Macro processing is what makes the direct translation to sexp so important.  Syntaxes  Here's the sexp syntax (which is admittedly not super pretty)  ;; line comment {function {fibFast n} {if {less n 2} n {fibUp n 2 1 0}}} {function {fibUp max count x y} {if {equal max count} {add x y} {fibUp max {add count 1} {add x y} x}}} {function {factorial n} {if {lessEqual n 1} 1 {mul n {factorial {subtr n 1}}}}} {add 5 {mul 4 2}} {mul 5 {add 4 2}} {add 5 {abs {mul 4 2}}} {add 1 {add v1 {dot v2 v3}}} {assoc y x} ;; association list lookup {tuple {1 2 3}} Here's the meta syntax that maps onetoone and is usable interchangeably with sexp syntax. It is columnsensitive once the colon is introduced. Meta syntax is transformed to sexp syntax before macro processing  ;; line comment function: fibFast(n) if: n < 2 n fibUp(n 2 1 0) function: fibUp(max count x y) if: max = count x + y fibUp(max count + 1 x + y x) function: factorial(n) if: n <= 1 1 n * factorial(n  1) 4 * 2 + 5 +(4 2) * 5 abs(4 * 2) + 5 dot(v2 v3) + v1 + 1 x[y] 1; 2; 3  All symbol resolution in the lexical scope of 'static' will be resolved statically. All resolution in the 'dynamic' scope will be resolved dynamically. The default scope when none is specified is 'static'. static: function: fibFast(n) if: n < 2 n fibUp(n 2 1 0) dynamic: function: fibUp(max count x y) if: max = count x + y fibUp(max count + 1 x + y x)  This is an overview of the definition functions  [listed in order of likely implementation] val: x(7) y(5) expression ;; bind immutable value(s) over an expression var: x(7) y(5) expression ;; bind mutable variable(s) over an expression vlz: x(1 + 1) expression ;; bind an expression to a name over another expression function: fn(x y) expression ;; declare a function lambda... ;; create a lambda macro... ;; define a lispstyle macro class... ;; class like in CLOS data... ;; an algebraic data type alias... ;; a type alias  Type inference  Types will be inferred where not specified. The type inference for the prototype will use the HindleyMilner algorithm. Type inference algorithm will be the same for symbols resolved at compiletime with static binding as those resolved at runtime with dynamic binding.  Miscellanea   So, anyways, that's the design so far. I ultimately hope I can get Cstyle programmers to consider using it. Edit: Updated to current design. By bryanedds at 20101220 05:29  LtU Forum  previous forum topic  next forum topic  other blogs  7945 reads

Browse archives
Active forum topics

Recent comments
2 weeks 23 hours ago
2 weeks 5 days ago
2 weeks 6 days ago
2 weeks 6 days ago
3 weeks 5 days ago
4 weeks 1 day ago
4 weeks 1 day ago
4 weeks 1 day ago
5 weeks 3 days ago
5 weeks 4 days ago