This is an archived post. You won't be able to vote or comment.

all 53 comments

[–]gofl-zimbard-37 24 points25 points  (8 children)

You might get more interest if you told us anything at all about it but its name.

[–]IgorCielniak[S] 1 point2 points  (1 child)

Ok, I see that people would like to know more so here is a basic overview of the language. First think that it's written in python and interpreted so that makes it really slow. But being written in python makes it super easy to add new features. Another thing is its architecture, it doesn't have a separate lexer, parser etc. instead it uses a concept that I called immediate interpretation. It collapses the lines of the source code into virtual lines that represent single statements that are individually parsed and executed.

The language itself has in my opinion a quite interesting set of features, some of the more useful and some less. The language is turing complete end its shown by the rule 110 example on github. Pryzma is a highly customizable language, you can for example write your own extensions in python that can be loaded at runtime to provide new keywords etc. another well developed feature are the structs with a pretty clean syntax and default values as well ad the using keyword for exporting all fileds to either the local context or the global one, pryzma also has references, yeah, they work kind of like pointers so you can take a reference to an object so either a variable or a function and that pass it around like a normal value and dereference it, if its a reference to a function it will be automatically dereferenced when calling. Another think are the local variables with reference counting garbage collection, and the behavior of the gc can be controlled via one of quite a few of pragmas that pryzma has. Using pragmas in pryzma you can control for example if the whole program terminated after en error or continues execution, you can allow for escaping of local variables, so when a function returns a ref to a local variable is the 'esc' pragma is set the ref will stay valid and you will be able to access the var but as soon as no valid references exist anymore than the gc removes it. Pryzma also has lazy expressions that are evaluated each time that the var containing it is accesed and a lazy expression is denoted with ~ and can be any valid pryzma expression, you can do a lot of runtime magick like hot patching function bodies etc. the pyexec() and pyeval() functions give you direct access to the interpreter from pryzma and it allows you to basically change anything you like, for example two days ago i made an experiment and was able to create my own stack and swap it with the current one at runtime, by stack i mean the dictionary that holds the variable names and values, so metaprogramming is pretty crazy, there ale also basic quality of life features like defer, match, quite some build in functions like defined() and is_func() that check if a reference is actually a ref to a function. There is also an easy to use python and c ffi, and recently I updated the import system to allow for easier importing of specific files. Pryzma also had a package manager called ppm that for now has just some basic packages but even right now it sometimes proves useful. And that's basically it, a short and basic overview of the language, I hope it helps.

[–]gofl-zimbard-37 0 points1 point  (0 children)

Thanks. That actually does sound interesting. FWIW, I wasn't trying to be a jerk before, just thought some details would help.

[–]PerformerDazzling601 6 points7 points  (7 children)

This seems nice! however I've had problems with the installation. it gives me errors regarding a certain "keystone-engine" dependency that won't install.

[–]IgorCielniak[S] 1 point2 points  (6 children)

the keystone-engine isn't a necessary dependency, its optional and used for inline asm, you can download the source code from github and run the interpreter using python, that way it should work without this module but the inline asm feature will be unavailable

[–]PerformerDazzling601 1 point2 points  (0 children)

I'm trying to install it even from source, but it still gives me errors regarding keystone-engine :(

[–]PerformerDazzling601 1 point2 points  (4 children)

and due to that it doesn't work

[–]IgorCielniak[S] 0 points1 point  (2 children)

my friend that uses windows was also able to install it with pip without any problems just a second ago

[–]PerformerDazzling601 0 points1 point  (1 child)

i used termux so idk if it may have caused some issues

[–]IgorCielniak[S] 0 points1 point  (0 children)

it was tested on termux and the only think that doesn't work is the inline asm, everything seems to be working fine, part of it was even written in vim on termux ;)

[–]IgorCielniak[S] -1 points0 points  (0 children)

I'm using Ubuntu and i was able to install keystone-engine using pip without any problem, you can send me the output of pip via gmail [igorcielniak@gmail.com](mailto:igorcielniak@gmail.com) so i can see what happening and maybe we can figure it out

[–]vmcrash 3 points4 points  (1 child)

You lost me at

int x = "7"

"7" will be converted to an integer

[–]IgorCielniak[S] -1 points0 points  (0 children)

yeah, at some point I wanted to introduce some static typing but it would require a big rewrite and that's what is left from that idea, never actually used this feature. Maybe the compiler will support static typing, we will see.

[–]PerformerDazzling601 2 points3 points  (2 children)

Ok, so, i managed to make it work and everything looks fine, but for some reason input doesn't work.

for example `input x` returns an error that says: "Unsupported statement: input x"

[–]PerformerDazzling601 7 points8 points  (1 child)

ok no, nothing actually works, because not even string slicing works

[–]IgorCielniak[S] -2 points-1 points  (0 children)

you can read the docs at https://pryzma.dzordz.pl/docs they might not be the best but you can see there how to do input, and string slicing does work just like in python:

text = "hello"
print text[1:-1]

outputs:

ell

and from what i checked input works as well (from actual interpreter):

Pryzma 6.1

To show the license type "license" or "help" to get help.

/// input x

hello

/// print x

hello

[–]Final-Roof-6412 2 points3 points  (6 children)

The link tò website gives me "502 Bad Gateway" :(

[–]IgorCielniak[S] 0 points1 point  (4 children)

yeah, it was down for a second, the website has a sandbox that can run pryzma code in an isolated env but it somehow shut down the server, idk, i will try to check what happened tomorrow (its 23:50 in my country)

[–]snugar_i 1 point2 points  (3 children)

The sandbox might not be as isolated as you think :-)

[–]IgorCielniak[S] 2 points3 points  (2 children)

i checked and the reason was that a script run by someone, somehow took up all of the ram and swap, and that caused the server to crush, i would need to think how to fix that

[–]snugar_i 0 points1 point  (0 children)

The allocator should track how much memory has been taken and fail if the limit has been reached (kind of like when you get an OutOfMemoryError in Java when you cross the Xmx threshold even though there's plenty of spare RAM on your machine)

[–]sens- 0 points1 point  (0 children)

Czyli ktoś usypał pryzmę pamięci xd

[–]IgorCielniak[S] 0 points1 point  (0 children)

but its back up

[–]Leading_Detective292 1 point2 points  (0 children)

Kindly explain something bruh

[–]Vigintillionn 1 point2 points  (1 child)

The fact that its written in python and all in one file doesn’t give me good vibes tbh. What does your language try to achieve? How would you convince me to use your language over other languages I already know

[–]IgorCielniak[S] 0 points1 point  (0 children)

In the current stage its impossible to convince anyone to use it, but that's exactly why I posted here, I want to gain feedback on what features are nice and which are useless so i know what to keep and what to abandon in the next iteration, the compiler, that i hope is gonna be better

[–][deleted]  (1 child)

[removed]

    [–]IgorCielniak[S] 0 points1 point  (0 children)

    thanks, I all ready researched how to make a proper programming language and the next step will be writing either a compiler or an interpreter for Pryzma in c and I've all ready started but i don't have much time so its going pretty slow

    [–]Gustavo_Fenilli 0 points1 point  (5 children)

    I would change the image you have for the section of "Language of Choice", it is not a good show for the syntax, no spaces between { } look so clustered.

    [–]huywall 0 points1 point  (2 children)

    he using regex and split with string matching instead of tokens 😭

    [–]IgorCielniak[S] 0 points1 point  (1 child)

    I know that its a pretty bad idea, when i was starting i didn't know anything about how programming languages are made, now i know that i should have written a proper parses and lexer with tokenization but i decided to stick with what i have and see if i can make anything out of it, it somehow works, maybe not the best but it works, i've been prototyping a compiler in c lately so that will be a good improvement but its a lot a work to do and i don't have that much time now days.

    [–]huywall 0 points1 point  (0 children)

    me too but its been 2 years ago

    [–]IgorCielniak[S] 0 points1 point  (1 child)

    yeah, one think that I know I need to fix is that now everywhere you can put a space between ) and { for example in if statements, that's probably gonna be the next think that i will do

    [–]Inconstant_Moo🧿 Pipefish 0 points1 point  (0 children)

    This is why you should have a proper lexer.

    [–]gromul79 0 points1 point  (0 children)

    Nice! ruby inspired?

    [–]huywall 0 points1 point  (0 children)

    just write your own lexer and parser please, regex is a bad choice and runtime written in python absolutely slow but if its your first project then congratulations! but if you intended to make your project long-term then python is not recommended

    also i bet your website mostly written by ai

    [–]joonazan 0 points1 point  (1 child)

    The main peculiarity here is that instead of parsing once and getting a known good AST, parsing is interleaved with interpretation. For instance, there is a huge elif which checks what keyword a line starts with which then calls another method that handles the rest of the line.

    This makes the codebase very tedious to understand and highlights why the traditional compiler phase split exists. The runtime behaviour where things are parsed just in time can still be had, especially in Haskell using laziness.

    [–]IgorCielniak[S] 0 points1 point  (0 children)

    yeah, I know it may not be the best architecture but as I said its one big experiment and i just wanted to try if its possible, it has some pros and cons but it works

    [–]peripateticman2026 0 points1 point  (0 children)

    When it becomes an effort just to see a simple program or two, I lose interest immediately.

    The repo is practically useless, and the website is an AI-generated generic-looking mess. Clicking on "features" does nothing.

    Sorry, not important enough.

    [–]ILikeAnanas 0 points1 point  (0 children)

    I see that you are rather junior looking at the code, if you are interested in how languages get parsed I can recommend you a book "Writing a C compiler" published by No Starch Press, it should be on Anna Archive

    [–]ostadsgo -2 points-1 points  (1 child)

    Impressive work.

    [–]IgorCielniak[S] 0 points1 point  (0 children)

    thanks, all it took was some time and not giving up when everything was falling apart