fadion / aria Goto Github PK
View Code? Open in Web Editor NEWExpressive, noiseless, interpreted, toy programming language
License: MIT License
Expressive, noiseless, interpreted, toy programming language
License: MIT License
Read through the entire Readme and came across a few typos:
If features mutable and immutable values
It features...
Converting between types is handle in a few ways
handled in a ...
Some would prefer more explicit way of calling:
... prefer a more explicit ...
That is all I could find, provided that I was more focused on the content than on the grammar :)
First of all, nice work. Love the clean syntax.
I do like the idea of immutable values, but you are creating immutable variables which IMHO is very limiting. Basically that makes each let
create a constant. You need immutable values, not immutable variables.
I now cannot change x at all? Not even increment it? How can you make a program to get sum of numbers? You can't create a new variable for each iteration of the summing loop.
In interpreter.go
, function runStringInfix
:
func (i *Interpreter) runStringInfix(operator string, left, right string) (DataType, error) {
switch operator {
case "+": // Concat two strings.
return &StringType{Value: left + right}, nil
case "<":
return i.nativeToBoolean(len(left) < len(right)), nil
case "<=":
return i.nativeToBoolean(len(left) <= len(right)), nil
case ">":
return i.nativeToBoolean(len(left) > len(right)), nil
case ">=":
return i.nativeToBoolean(len(left) >= len(right)), nil
case "==":
return i.nativeToBoolean(left == right), nil
case "!=":
return i.nativeToBoolean(left != right), nil
case "..": // Range between two characters.
return i.runRangeStringInfix(left, right)
default:
return nil, fmt.Errorf("Unsupported String operator '%s'", operator)
}
}
You used len(str1) and len(str2) to compare two strings, this way is not very correct. In go, we could simply use str1<str2
, str1>=str2
, etc. that would do the compare.
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.