4 ms·
I created the BIPLAN programming language, what do you think about it?
- gioscarab 6y agoBIPLAN (Byte-coded Interpreted Programming Language) is an experimental programming language based on a recursive descent parser that uses only static memory allocation and operates a completely software-defined virtual machine that does not require a garbage collector. It's human-readable language called BIPLAN is compiled in an 7-bit ASCII virtual-machine language called BIP.
- besnn00 6y agoLooks cool. I’m guessing this is for embedded, right?
- gioscarab 6y agoCiao besn, yes it is designed for constrained environments and now runs only on Arduino compatible devices, although it already supports system calls abstractions to be easily compiled in other environments.
- airstrike 6y agoMeta comment: Most posts like these start with "Show HN:" in the title so that others know it's something you created and want to get feedback on, so maybe consider changing your title to match that custom ;-) https://news.ycombinator.com/show https://news.ycombinator.com/show
- sam0x17 6y agoThis is a beautiful little language. Have you looked at Zig? Similar aim.
- vkazanov 6y agoI like zig and all. but this language is nothing like Zig!
- johnisgood 6y agoHe only said aim. Perhaps it hit 5 km away from the bullseye. :D
- sshine 6y agoLooks cool! Why is all your code in .h files?
- slaymaker1907 6y agoMy guess is because header files only involve pretty minimal build setup. Usually that design is with a single .h file though.
- sgtnoodle 6y agoThe project looks interesting. I am always a fan of embedded virtual machines. I have some questions after skimming the documentation. Why do built-in functions use a keyword/operator syntax for arguments, while user defined functions use parentheses? That seems confusing (and was deemed a mistake in python worthy of a decade of pain to remedy.) It would certainly make sense to special case their implementation in byte code for efficiency, but since there's a compilation step, why does the syntax need to change? Why did you choose to go with Arduino function names? Do you like the camelCasing? Why is there both a "next" keyword and a "continue" keyword? Don't they basically do the same thing? If the purpose of "next" specifically is to mark the end of scope of the loop, why not use the word "done" or another word that isn't synonymous with "continue"? If space and efficiency are a priority, and there's a compiler from a higher level language, why did you go with an ASCII-code rather than a true byte-code? That gives you 95 visible characters per byte, which seems to potentially waste 18% or so of program space.
- gioscarab 6y agoCiao, yes I agree with you, I will work to remove parentheses from functions. What you would suggest instead of the arduino function names? You are right also about next and continue, thank you. The fact that the machine language is an ASCII string looks like really handy for many different reasons.
- sgtnoodle 6y agoI actually suggest keeping the parentheses, and updating the system functions to also use them. That way, you can potentially more easily support nesting of compound expressions in function calls. Re: naming for IO functions, it's really up to you. I personally try to avoid abbreviations for readability, except for incredibly common ones. One idea: init_pin(index, mode) get_pin(index) get_pin_mode(index) set_pin_mode(index, mode) Or CamelCase, InitPin, GetPin, etc. Mode is an enum with values for input, input_pullup, input_pulldown, output_low, output_high. For getting timestamps: milliseconds() microseconds() For computing deltas in time between two timestamps correctly with rollover (Provided by the system in case the data type is unsigned. Returns 0 if t2 > t1): time_left(t1, t2)
- gioscarab 6y agoAny of you would help me to run it on Windows/Linux? I would need some help with the system calls
- captainredbeard 6y agoFun but a toy