-
Notifications
You must be signed in to change notification settings - Fork 1
dev@lang
Olivier DALET edited this page Feb 22, 2021
·
11 revisions
- https://blogs.oracle.com/developers/announcing-graalvm
- http://www.graalvm.org/docs/graalvm-as-a-platform/
- https://github.com/oracle/graal
- https://github.com/oracle/graal/blob/master/truffle/docs/Languages.md
- https://ericlippert.com/2018/10/31/anti-unification-part-2/ (then go back back back...)
https://medium.com/@mikhail.barash.mikbar
- ABC of Kotlin: https://medium.com/@mikhail.barash.mikbar/an-abc-of-kotlin-62b1867df8c2
- ABC of Jetbrain's MPS: https://medium.com/@mikhail.barash.mikbar/abc-of-jetbrains-mps-33bed30c330b
- A tale about domain-specific languages: https://medium.com/@mikhail.barash.mikbar/a-tale-about-domain-specific-languages-bde2ace22f6c
- Looking at code through the prism of JetBrains MPS: https://medium.com/@mikhail.barash.mikbar/looking-at-code-through-the-prism-of-jetbrains-mps-8e9b70e3257d
- Papers on programming languages: ideas from 70's for today: https://medium.com/@mikhail.barash.mikbar/papers-on-programming-languages-ideas-from-70s-for-today-2931891d4dbd
- Language Wheel?�?language engineering for everyone: https://medium.com/@mikhail.barash.mikbar/language-wheel-language-engineering-for-everyone-8a2a55e23a45
- Bosque
-
Koka
- https://github.com/koka-lang/koka
- https://www.rise4fun.com/koka/tutorial
- See also Eff (Non-MS)
- Ruby-like, statically type checked, built-in type inference
- C-bindings
- Null representation: union between the type and nil
Example:
if rand(2) > 0
my_string = "hello world"
end
puts my_string.upcase
gives:
$ crystal hello_world.cr
Error in hello_world.cr:5: undefined method 'upcase' for Nil (compile-time type is (String | Nil))
puts my_string.upcase
- Python-like
- Inspiration from Ada and modula
- Modern type system with local type inference, tuples, generics and sum types.
- Nim's memory management is deterministic and customizable with destructors and move semantics, inspired by C++ and Rust.
import strformat
type
Person = object
name: string
age: Natural # Ensures the age is positive
let people = [
Person(name: "John", age: 45),
Person(name: "Kate", age: 30)
]
for person in people:
# Type-safe string interpolation,
# evaluated at compile time.
echo(fmt"{person.name} is {person.age} years old")
const std = @import("std");
const json = std.json;
const payload =
\\{
\\ "vals": {
\\ "testing": 1,
\\ "production": 42
\\ },
\\ "uptime": 9999
\\}
;
const Config = struct {
vals: struct { testing: u8, production: u8 },
uptime: u64,
};
const config = x: {
var stream = json.TokenStream.init(payload);
const res = json.parse(Config, &stream, .{});
// Assert no error can occur since we are
// parsing this JSON at comptime!
break :x res catch unreachable;
};
pub fn main() !void {
if (config.vals.production > 50) {
@compileError("only up to 50 supported");
}
std.log.info("up={d}", .{config.uptime});
}