←back to thread

16 points Hashex129542 | 1 comments | | HN request time: 0.208s | source

I'm developing a programming language, the keywords and features mostly based on Swift 5 but some additional features like,

1. async function will be called from no async function but no async/await keyword. If you want to block main thread then block_main() function will be used. block_main() /* operations */ unblock_main()

2. protocol can inherit another protocol(s) & protocol can confirm a class like swift.

3. no `let`. only `var`. compiler can optimize further.

4. if (a == (10 || 20 || 30) || b == a) && c { }

5. `Asterisk` is replaced to `x` operator for mul operations.

What are the features you found or you need in a programming language?

Show context
mikewarot ◴[] No.42201983[source]
If you can squeeze it in.... A magical assignment like :== which declares the left value is ALWAYS equal to the expression on the right after that point, so that if any part of the expression on the right changes, the left gets updates as a dependency.

I once saw this in a language called metamine and the demo was amazing, mixed imperative and declarative programming interweaved.

replies(1): >>42211866 #
1. blharr ◴[] No.42211866[source]
Hmm, this can be done with macros in C/C++ right?

It could also just be defined in the "setter" for x, that x Y = x + 2, so everything you update x you update Y

I don't particularly like it because, what if you want to change y? Do you have to change x correspondingy?