Skip to content

ConorOBrien-Foxx/Minat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minat

An experimental version of Attache, which compiles to things.

Motivation

I want to start with efficiency in mind.

Print => 0:10

Might be compiled to

(0..10).each &Globals["Print"]

or

f[x, y, z] := x + 2 * y + z

min[x, y] :: {
    If[x < y, x, y]
}

Print[min[f[1, 2, 3], 4]]

to

Globals["f"] = Function.new(lambda { |scope, args|
    x, y, z = args
    x + 2 * y + z
})
Globals["min"] = Function.new(lambda { |scope, args|
    x, y = args
    (x < y) ? x : y
})

Globals["Print"][scope,
    Globals["min"][scope,
        Globals["f"][scope,
            1, 2, 3
        ],
        4
    ]
]

About

experimental version of Attache, compiling

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages