r/Compilers • • 26d ago

Could someone test my programming language?

http://github.com/rhyelt/Comprinly

Comprinly is a partially-vibe coded language I made. I test every update and modify files Claude builds except documentations, I am not a good writer as you can see on my Rhyel-Assembly-Documentary repo. I can modify and I understand the code Claude makes, I only modify, I can't actually make files, I only use Claude's files as base. I work on updates locally. I tested the language with 1000 aggressive batch fuzzer tests but that wasn't enough to prove the maturity of the language since it wasn't a human that did it. I have tested the language myself but theyre only minor tests. If you are willing to help by testing, documenting or giving suggestions, I'd love to accept your help. If you are just here to bash on me for using AI on the project, you can leave the post alone. Thanks.

0 Upvotes

7 comments sorted by

3

u/[deleted] 26d ago

Comprinly (cly) is a mature, feature-packed programming language and a dependable tool with almost the same syntax as NASM.

I don't get it. This is just an assembler, right?

It reads x86, ARM64 and RISC-V from the same syntax. The commands you type do not change when the CPU does.

So how does that work? Presumably you still to know your target CPU, since they have different instructions and registers. ABIs will also differ depending on platform.

I don't understand the use-cases, and why someone would use this rather than a HLL or a conventional assembler specific to a CPU.

It is simple, optimized, portable and fast... hence the slogan.

Simple compared to what? (Assembly is usually much harder to code in.)

What exactly will be optimised?

How is it portable: will it convert x64 code to run on RISC V for example?

And what about it is fast?

1

u/Upper-Ad4677 26d ago

Comprinly is basically an assembler/compiler that tries to make writing assembly more consistent across different architectures. You still work with each CPU’s own instructions and registers, but the syntax is still familiar. The concept is to make low-level programming simpler but still in control, while keeping compilation fast and generating optimized code.

2

u/[deleted] 25d ago

I just tried your cly.exe version for Windows on some NASM examples.

One problem is that it couldn't link to C library functions, for example 'printf'. I used option '-nasm' (it didn't like -fwin64), and also '-needed' with the path to MSVCRT.DLL, a C library.

With a bigger test, it reported some undefined names, even though they were actually defined. It looks like it doesn't like labels starting with '$'.

Aside from those problems, I tested assembly speed on a 130Kloc input (the output of a compiler). It spent about 4 seconds before it reported the unresolved external symbols.

Now, while this is considerably faster than NASM itself, NASM has some bug which slows it down exponentially on inputs like this (I think it took about a minute).

The equivalent file in my normal ASM syntax takes 65ms to assemble to EXE, while in GAS syntax, 'as' took about 280ms to produce a .o file (running under WSL).

1

u/Upper-Ad4677 25d ago

Thank you for the contribution! I havent tested it for windows so this is very helpful for me.

1

u/[deleted] 26d ago

OK. So what are the advantages of this for x64 compared to using NASM, say? Are directives consistent across targets?

The concept is to make low-level programming simpler

How does it do that - can you can give an example comparing Comprinly to an alternative?

while keeping compilation fast

There is no compilation that I can see: this is assembly. And assembling is already very fast, it terms of lines-per-second compared with HLLs. The trouble is that assembly code takes a lot more lines to express a program compared to a HLL!

So it might not be that much faster overall. But you haven't anyway given any figures (how fast can Comprinly process source code to binary?), so such a statement is meaningless.

and generating optimized code.

This is still not clear. What likely optimisations can be done when the program already consists of explicit native code instructions?

Can you give an example of some x64 input say, and what it optimises to.

What happens if the input is tight, efficient native code generated by an optimising HLL compiler - what can it add to it?

0

u/Upper-Ad4677 26d ago

Well compared to NASM, Comprinly offers more forgiving syntax, automatic entry-point handling, section creation, typo hints and built-in linking. Most directives are shared across architectures, while instructions remain CPU-specific.
It also handles assembling and linking all by itself. I have files for testing the optimization, you can check and test the files in test/opt.