!HoNet's in-house interpreter, strongly influenced by [wiki:Modula-3 Modula-3 programming language]. Can be found in [http://yum.m3w.org/m3w.repo yum repository] with source rpm and all related packages. Current tasks/ideas for XL are: * Make runtime "extensible" at runtime -- possibility to "eval" whole block of code at runtime -- interpret it, and setup it for execution, then execute it in frame of its eval. === Examples (idea phase) === {{{ #!html
| Source code | Resulting in | |
|---|---|---|
| }}} {{{ var a, b; begin a := 1; b := 3; ... eval ":Result1: $a+b$"; eval "b := a + b;"; :Result2: $a+b$ end }}} {{{ #!html | }}} {{{ Result1: 4 Result2: 5 }}} {{{ #!html | |
| Source code | Resulting in | |
|---|---|---|
| }}} {{{ var a, b; begin a := 1; b := 3; ... eval " module inside; var c; proc d(m, n) = begin return m*c+n; end d; begin c := 4; end inside. "; :Result3: $d(2,3)$ ... }}} {{{ #!html | }}} {{{ Result3: 11 }}} {{{ #!html | |
| Source code | Resulting in | |
|---|---|---|
| }}} {{{ module c; var f, g; proc pera() = var g := 17; begin f := "while false do end; printf('%s je g\\n', g);"; :prasing "$f$" in pera() eval(f); end pera; begin g := 33; :g je sada $g$ f := "while g>4 do g := g - 1; end;"; :prasing "$f$" eval(f); :g je sada $g$ : f := "{'ab' := 1} + {2 := 3,3}"; :prasing "$f$" g := eval(f); :$g$ : f := '[2+3, "ab" + "@" + "cd"]'; :prasing "$f$" g, f := eval(f); :g = $g$, f = $f$ : pera(); end c. }}} {{{ #!html | }}} {{{ g je sada 33 prasing "while g>4 do g := g - 1; end;" g je sada 4 prasing "{'ab' := 1} + {2 := 3,3}" { 3, 2 := 3, ab := 1 } prasing "[2+3, "ab" + "@" + "cd"]" g = 5, f = ab@cd prasing "while false do end; printf('%s je g\n', g);" in pera() 17 je g }}} {{{ #!html | |