tkharaishvili / ephemera Goto Github PK
View Code? Open in Web Editor NEWThe Ephemera programming language
The Ephemera programming language
Given:
fun Identity(pre x:number?)
{
return x
}
def x: number? = 3
def y = x?.Identity()
the last expression unsurprisingly gets transpiled to x?.Identity()
but that's a compile time error in C# because the function expects a nullable number and the ?.
operator "unwraps" it into a regular number which the compiler complains about.
I need to decide whether that expression should be allowed in Ephemera and if yes, what it should mean.
Currently the following expression:
x < y() < z
gets transpiled to an inline function invocation in C#. The generated code can and should be simpler.
Ephemera/Ephemera/Lexing/Lexer.cs
Line 96 in dcf2d03
It gets tokenized as an AndOperator
! I can't believe this remained unnoticed causing no problems whatsoever for this long!
Expressions like !!true
and --3
don't work.
It's a no-brainer that double(or triple) negation for booleans should work but it doesn't work for numbers in languages I'm familiar with. I'm thinking that's because --identifier
means decrementing a number in C-style languages which I don't and am not planning to have here.
A funny way to avoid problems
With code like this:
def x = 5
def y = x
The compiler checks for the existence of possible ()
after x
. That check is not null-safe and since there is no other token after that, the null ref exception gets thrown.
There should be a token after that btw. An EOF token.
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.