Live data from Hacker News

Show HN: Imba – I have spent 7 years creating a programming language for the web

news.ycombinator.com

61–70 of 354 posts

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#61
post #31

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?

Hard to describe, but it feels like it makes much, much more sense. I think it's because the divide between html/css/js is supposed to be one of concerns, but in reality the concerns are interwoven in many ways, and leads to issues when using them at scale. None of the scaling issues I've faced in the past re-occurred when I used a framework that combined the languages into single files.

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#62
post #33

Earlier quoted context omitted.

Personally I don’t use any languages with reserved words

that limits the number of languages to a handful. like brainfuck and similar ones. doesn't it?

Lisps don't have reserved words, generally.

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#64
post #33

Earlier quoted context omitted.

Personally I don’t use any languages with reserved words

that limits the number of languages to a handful. like brainfuck and similar ones. doesn't it?

APL cheats by making everything a symbol.

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#65
post #62
post #33

Earlier quoted context omitted.

that limits the number of languages to a handful. like brainfuck and similar ones. doesn't it?

Lisps don't have reserved words, generally.

Not even cons and defun?

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#66
post #45

is 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 :)

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

#67
post #5

One 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 :)

You are obviously right.

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

#68

Quick question - how does the memoized DOM compare with no-virtual-dom-at-all approach of something like Svelte?

https://krausest.github.io/js-framework-benchmark/2020/table...

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

#69
post #45

Earlier 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?

You can typeset variables, parameters etc (ie. see the code in https://dev.to/somebee/global-type-augmentations-with-automa...). But declaring standalone types is still done in `.d.ts` files. Imho, the type inference in ts/js is getting so good that I very rarely need to declare any explicit types in my own projects.

Re: Show HN: Imba – I have spent 7 years creating a programming language for the web

#70
post #5

One 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 :)

I've thought about this a lot. I considered "con" for constants. I don't hate it. It also works as a double entendre-- "con" in Spanish means "with". So the following code could be read as "with name equal to Brad".

  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.
Post reply on HN