cuddlefishie / natpl Goto Github PK
View Code? Open in Web Editor NEWProgramming language / calculator for natural sciences
License: GNU Affero General Public License v3.0
Programming language / calculator for natural sciences
License: GNU Affero General Public License v3.0
This would allow more re-use of definitions.
Ideally for disambiguation also a namespacing mechansim should be present.
Maybe for "import everything" and "only import the name of the namespace" different statement types could be used?
import OtherFile
for loading OtherFile.nat
from a set of known locations and then making all definitions usableuse OtherFile
for loading OtherFile.nat
from a set of known locations and then allowing the use of definitions using OtherFile.some_name
This could be done using a "meta switch" in the PEPL and maybe even be a command in itself in the language, so that user scripts (see #14) could set a default.
At the moment the parser only handles one line at a time and all spans are relative to that line.
When errors occur in a different file (see #15) then the proper error location should be tracked.
Handling multi-line definitions/expressions would also allow for more features later on, like if
-else
conditionals.
The ValueKind
/Unit
split makes it so that elements in a vector all have to have the same unit.
In the long run having a way to support different units inside a vector (which would be more like tuples at that point then) might prove benefitial.
Right now writing x = 5
has two meanings:
x
is not yet defined it will be defined to the value 5
x
is defined then it is asserted that x
is equal to 5
and error if that's not the caseThe assertion feature is very rarely used since the main usecase of natpl
is in a REPL environment anyway.
This also means it's not possible to update the value of a variable.
It would be better to treat any <var> = <expr>
item as a definition/value update. To implement that, the line item for disambiguation needs to be removed. Of course that requires small changes to the parser too.
Line 87 in 602abff
This would allow users to create their own defaults for what is useful to them.
Similarly to the prelude, it would be automatically loaded on startup, but unlike the prelude could be changed by the users without recompiling the program.
Possible locations for the file:
~/.natpl/user_prelude.nat
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.