Live data from Hacker News

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

news.ycombinator.com

41–50 of 354 posts

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

#42
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?

For web apps, you often want your content/HTML to dynamically render different elements depending on application state. Using a separate template file and having your logic plug into the template is often more complicated than just having your flow logic (if/else chains checking application state) return bits of relevant HTML/content inline.

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

#43

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?

Interesting.

I had the impression "tightly coupled with TS" would mean type checking.

That's sad.

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

#44
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?

Personally I've always been kind of confused by the common best practice of separating everything. React and Vue single file components made so much sense to me.

I guess if I were to rationalize my position, I'd say it's because I have a hard time finding related things when they're separate. If a button or "a" tag have a special click handler, I want to know when looking at it. If it just has classes, then I don't know if that are for style or if they're for behavior. I know there are some conventions out there where you prefix classes with "js-" etc, but if you just use "onclick" then it's obvious and you don't need a convention.

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

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

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

#46
I just want to compliment the OP on a very clear and comprehensive website at https://imba.io/. It clearly explains (by showing and telling) what Imba is, why I should care, how it works and how to get started. The floating demo applications even work well on mobile. Rare to see this level of polish for these things.

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

#47
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?

Personally I've always been kind of confused by the common best practice of separating everything. React and Vue single file components made so much sense to me. I guess if I were to rationalize my position, I'd say it's because I have a hard time finding related things when they're separate. If a button or "a" tag have a special click handler, I want to know when looking at it. If it just has classes, then I don't k…

It's fine if you have a few colors, but with 50+ lines of SASS/component I'd rather have them separately.

> I have a hard time finding related things when they're separate.

Store them in the same directory?

I agree on the events/business logic that they make sense to couple with the template code.

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

#50
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?

It's because of components.

Web app dev has started focusing on single, separate, reusable components instead of trying to design everything on the page at once.

Often, in these components, the HTML, CSS, and JS is still separated, but now (theoretically) you can plug that component in anywhere (even a different app) and, as long as you feed it the right data, it should just work.

Post reply on HN