ballasi / stck Goto Github PK
View Code? Open in Web Editor NEWAn esoteric programming language based around stacks
License: GNU General Public License v3.0
An esoteric programming language based around stacks
License: GNU General Public License v3.0
The code requires severe cleanup as it is some sort of a mess right now. Some work has already been done for the command
s but there is still work to do.
Here is the target structure for the project:
src
├── commands
│ ├── command1.h
│ ├── ...
│ └── commandN.h
├── utils
│ ├── log.c
│ ├── log.h
│ ├── stack.c
│ ├── stack.h
│ ├── hashmap.c
│ └── hashmap.h
├── commands.c
├── commands.h
├── stck.c
├── stck.h
├── utils.h
└── main.c
Some functions are also quite long and unbearable to look at, documenting and commenting the code is also a todo.
Re-factorization road-map:
variable
to hashmap
Following code doesn't work as expected:
42 \stck =
~stck print
It prints ~stck
and not 42
as the variable saved is \stck
and not stck
.
Right now, stck only uses one main stack, but in the future, I am interested in implementing a new stack with the {
and }
commands.
Rather than having one stack for the whole program, it will have a second one. The first stack is the execution process and is never meant to be removed, it is basically the stack that is currently in use by the program at its current form.
When the {
command is called, it will add another stack (called the "child" process). Child processes are not executed and are popped when the }
command is called (only command executed by child processes), returning to the execution stack.
I have to see how it is meant to work as this is supposed to be an entry-point in making functions, if/while calls and many more. A nice thing that could be done is to work with parentheses:
name ( v ) { content }
In any case, once the }
command is called, it keeps the child stack, pops everything between the parentheses in the execution, pops name
. Here, the program can behave differently depending on the value of if
:
if
: in that case it applies the elements on the child process if v
is truewhile
: unsure of the implementation (because other children processes might happen in a while, essentially destroying the child process, maybe it is a good idea to keep it in an functional PL way without any while
but with recursion? another way would be to implement it in a completely other way)name
and value=(args, content) where args=v
The following code returns a segfault:
1 a =
2 a =
This is obviously not wanted and should update the value.
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.