Built from the ground up to look pretty.
Dino is a C-like language with a focus on being aesthetically pleasing.
See the language specification for more details.
foo.Foo()
a() | b() // the line break operator is '|'.
The most important thing in a language, really.
if b ≠ 0:
a ≡ b
The IDE will make entering them convenient, I promise!
// unless - equivalent to "if not":
unless a: // Use ':' rather than braces if a block only has one statement
return 10
// postfix conditionals
break if a = 10
// python-style comparisons
if 10 < a ≤ 20 { /* ... */ }
// Shorthand variable declarations
int a ≡ 1
var a ≡ 1
a :≡ 1
// easy type checks and conversions
if a is int {
i :≡ a as int
// Do stuff with integers...
}
An interpreter for the esoteric language Brainfuck.
This example can currently be fully built by the compiler.
import "std"
namespace BrainF {
char[30000] tape
void Interpret(string input) {
int ptr ≡ 0
for i :≡ 0 | i < input.Size | i++ {
switch input.Get(i) {
case '>': ptr++
case '<': ptr--
case '+': tape[ptr]++
case '-': tape[ptr]--
case '.': Std.PrintC(tape[ptr])
case ',': tape[ptr] ≡ Std.GetChar()
case ']': if tape[ptr] ≠ '\0':
for loop :≡ 1 | loop > 0
switch input.Get(i--) {
case '[': loop--
case ']': loop++
}
}
}
}
void Main() {
// Hello World!
Interpret("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.")
}
}
- Strings with escaped characters (eg. "\n")
-
Type switches
-
Groups
-
Generic types
-
Vararg functions
Everything that's missing in the parser plus:
-
Blank identifier
-
Generics
Everything that's missing in the parser plus:
-
Closures (aka function literals)
-
Switches with non-constant/enumerable values
-
the "is" operator for things known at runtime
-
array bounds checks
-
proper debug information
-
A proper explanation for how literals are handled
-
A proper explanation for namespaces
-
A proper explanation for function calls
Some ideas ordered by the chance of them actually ending up as part of the final design:
-
Implicit conversions for literal types
-
Initializers
-
Better syntax for try/catch
-
"each" loop (aka "foreach") + range operator
-
Type aliases
-
Type extensions
-
Operator overloading
-
Default function argument values
-
implements a runtime for the language and link it in when compiling
-
implement some sort of basic standard library
-
some useful warning (unused variables, etc.)