henesy / limbobyexample Goto Github PK
View Code? Open in Web Editor NEWExamples for the Limbo Programming Language
License: MIT License
Examples for the Limbo Programming Language
License: MIT License
Showing off how various Limbo programs compile to Dis and how to craft Dis assembly by hand would be nice.
This isn't particularly high priority.
Provide an example of writing a variety of custom C programs/libraries and calling them from Limbo in Inferno as drivers, or so.
The for { T => ; }
statement can be used in an adt[T] as well.
From qrstuv on #inferno:
implement Dongmap;
include "sys.m";
sys: Sys;
include "draw.m";
Dongmap: module {
init: fn(nil: ref Draw->Context, nil: list of string);
};
Map: adt[K, V]
for { K => hash: fn(nil: self K): int; } { # ← This right here
v: V;
add: fn(nil: self ref Map[K, V], key: K, val: V);
find: fn(nil: self ref Map[K, V], key: K): V;
};
Wang: adt {
hash: fn(nil: self ref Wang): int;
};
WingDingDingaling: adt {
sz: int;
};
Map[K, V].add(m: self ref Map[K, V], key: K, val: V)
{
m.v = val;
}
Map[K, V].find(m: self ref Map[K, V], key: K): V
{
return m.v;
}
Wang.hash(nil: self ref Wang): int
{
return 69105;
}
init(nil: ref Draw->Context, nil: list of string)
{
sys = load Sys Sys->PATH;
m := ref Map[ref Wang, ref WingDingDingaling](ref WingDingDingaling(2));
m.add(ref Wang, ref WingDingDingaling(10));
sys->print("%d\n", m.find(ref Wang).sz);
}
As per title.
Something like #µ or smth that converts ascii to small unicode subtext when written to it.
Who knows.
Polymorphic modules needs their
{ for T => Stringify }
stuff in the module definition if they're to be exported (See: arrays.m, lists.m)
This was discussed on the #inferno channel awhile ago.
Theoretically you could express a channel chan
type as a file and read/write memory addresses through the channel file between programs (using fp register indirection?).
Theoretically this could mean that two programs could share data structures between each other assuming they are in the same Inferno instance and share the same loaded module definitions for the data, thus avoiding serialization of their data structures.
This is not especially useful as it would not function between Inferno instances (such as across networks).
Really need important part rephrased into better language
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.