Looks cool. I'm honestly curious as to why a lot of new web languages/frameworks are mixing logic and content in the same file again though. The distinction between HTML, JS and CSS always made perfect sense to me. Anyone care to enlighten me?
Show HN: Imba – I have spent 7 years creating a programming language for the web
61–70 of 354 posts
Re: Show HN: Imba – I have spent 7 years creating a programming language for the web
#62Re: Show HN: Imba – I have spent 7 years creating a programming language for the web
#63Re: Show HN: Imba – I have spent 7 years creating a programming language for the web
#64Re: Show HN: Imba – I have spent 7 years creating a programming language for the web
#65Re: Show HN: Imba – I have spent 7 years creating a programming language for the web
#66is there any particular reason why there doesn’t seem to be built-in type-checking system? i know it still seems to be a “personal preference” whether to check one’s types, but i wonder if any thought was given to including it?
There is built-in type-checking, but currently only via the tooling. It integrates with TS as a language service plugin ( https://github.com/Microsoft/TypeScript/wiki/Writing-a-Langu... ) so you get great warnings/errors, type inference and much more. To define standalone types or interfaces you still need to use `.d.ts` files, but that may change in the future :)
Re: Show HN: Imba – I have spent 7 years creating a programming language for the web
#67One thing that irks me about Javascript is "const". I think it should have been called "con". "var", "let", "con". So the first thing I did here is look up the docs and see how variables are declared. Aaarghh.. "let" and "const" again :)
The 'const' nomenclature is an abomination before science and human progress. However, given the prior art, I don't think we can hold it against a new/emerging language.
Anders, help us! Do the right thing. You are the only one who can.
(Of course, 'const' could be grandfathered and still work forever. Right-minded people, please upvote this obviously-right person at least back to a neutral #000.)
Re: Show HN: Imba – I have spent 7 years creating a programming language for the web
#68Quick question - how does the memoized DOM compare with no-virtual-dom-at-all approach of something like Svelte?
This lets you choose from multiple frameworks - comparing svelte against a few react variations, what I saw was that svelte was always fastest, but usually by a factor less than 2 (any react was 1.x times slower than the svelte).
The imba vs react numbers (from the article at https://www.freecodecamp.org/news/the-virtual-dom-is-slow-me...) shows a 30-40x speed difference.
Re: Show HN: Imba – I have spent 7 years creating a programming language for the web
#69Earlier quoted context omitted.
There is built-in type-checking, but currently only via the tooling. It integrates with TS as a language service plugin ( https://github.com/Microsoft/TypeScript/wiki/Writing-a-Langu... ) so you get great warnings/errors, type inference and much more. To define standalone types or interfaces you still need to use `.d.ts` files, but that may change in the future :)
that is to say, the types are not part of the syntax in any way?
Re: Show HN: Imba – I have spent 7 years creating a programming language for the web
#70One thing that irks me about Javascript is "const". I think it should have been called "con". "var", "let", "con". So the first thing I did here is look up the docs and see how variables are declared. Aaarghh.. "let" and "const" again :)
con name = 'Brad'
I can't help but feel that it's somewhat jarring though.If I had my druthers, I think I would choose "var" and "def" to declare mutable and immutable variables, respectively.
def PI = 3.1
def degreesToRadians = degrees => degrees * (PI / 180)
var degrees = 180
var radians = degreesToRadians(degrees)
Edit: After thinking about it some more, I think I prefer "const" over "con", but "def" over both.