←back to thread

17 points Hashex129542 | 1 comments | | HN request time: 0.211s | 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
giaour ◴[] No.42206819[source]
> no `let`. only `var`. compiler can optimize further.

This is not an "additional feature" so much as removing a feature. One reason a programmer might declare something to be a constant is to prevent the symbol from being rebound. You're right that one consequence of using `let` instead of `var` is that the compiler can more aggressively optimize constants, but the primary consequence is to capture and enforce the programmer's intent that the binding be immutable.

replies(1): >>42210211 #
1. Hashex129542 ◴[] No.42210211[source]
Yes, got it. Thanks :)