Live data from Hacker News

I created the BIPLAN programming language, what do you think about it?

github.com

11–20 of 20 posts

Re: I created the BIPLAN programming language, what do you think about it?

#12

The 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 by…

Ciao, 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.

Re: I created the BIPLAN programming language, what do you think about it?

#14
post #6

BIPLAN (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.

Have you ever used it for a project? Did it help you save time or debugging?

I have worked on it few years because I would like to use it on a custom computer design I have in mind. Something like 80s BASIC computers with a more modern language and quicker speed.

Re: I created the BIPLAN programming language, what do you think about it?

#15

The 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 by…

Thinking about it more in detail, functions require the parentheses to show where the call ends. I obviously could count the number of expected parameters as function is defined, but that leaves room for error, and a creepy syntax,

ie: sum 2, multiply 2, 2, 2

for which function is the last parameter for?

You are right about the function names, I am not forced to use the camel form which I do not love, it could be serial_write or even serial write

Re: I created the BIPLAN programming language, what do you think about it?

#17
post #7

This is a beautiful little language. Have you looked at Zig? Similar aim.

I like zig and all. but this language is nothing like Zig!

He only said aim. Perhaps it hit 5 km away from the bullseye. :D

Re: I created the BIPLAN programming language, what do you think about it?

#18

The 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 by…

Ciao, 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.

I 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)

Re: I created the BIPLAN programming language, what do you think about it?

#19

Earlier quoted context omitted.

Ciao, 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.

I 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…

I really need some help on real-time operative systems, the interface for windows is more or less ready, and the code should work on win out of the box, it should be rather simple to create a console program that can:

BIPLAN compile program.txt (compiles in program.bp/bip/bipl)

BIPLAN run program.bp/bip/bipl

would be helpful and fun to have it running on windows or linux.

Re: I created the BIPLAN programming language, what do you think about it?

#20

The 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 by…

Thinking about it more in detail, functions require the parentheses to show where the call ends. I obviously could count the number of expected parameters as function is defined, but that leaves room for error, and a creepy syntax, ie: sum 2, multiply 2, 2, 2 for which function is the last parameter for? You are right about the function names, I am not forced to use the camel form which I do not love, it could be ser…

This is Polish Notation, and it does not have this problem as long as you don't allow variadic functions. If functions always consume the same number of arguments, it's no problem at all.

This is basically how concatenative stack-based languages do it, although by convention they put the arguments before the function call. (Reverse Polish Notation) In Forth, your example would be written one of the following two ways, depending on whether multiply() or sum() is consuming the extra 2:

2 2 2 * 2 + +

> 8

2 2 2 * * 2 +

> 10

Also valid would be:

2 2 2 * 2 +

> 2 6

where the left-most 2 is not consumed, but rather is left in place.

Post reply on HN