r/AskProgramming • • Aug 16 '21

I have spent 7 years creating a JavaScript alternative, would love to hear your feedback

Hey all 👋

My name is Sindre, and I am the CTO of a YC-backed startup. For the last 7 years, I have written all my web apps in a programming language (Imba) that works as a clean and fast JavaScript alternative.

In the process of launching a major overhaul of Imba, I wanted to share it with this subreddit, in case anyone are interested in learning more about it. I would love to hear people's feedback as well! All constructive criticism is appreciated!

So, over to the nitty gritty details. Imba compiles to JavaScript and it is meant as an alternative that can give you increased dev productivity. So this is not a toy project or an academic exercise, it is extracted from a real project trying to solve real problems. It has been through countless iterations over the past 7 years, striving to be the perfect language for developing web applications.

In this last iteration, I have added tons of cool things like touch modifiers, inline styles, optional types and great tooling that integrates deeply with TypeScript. With this version I feel that I am very close to my vision for what Imba should be. In other words; it is finally ready for public consumption. I'd wholeheartedly advice you to look into it and give it a whirl if you are interested in web development :)

Check out this video on how to build a counter with Imba in less than 1 minute, or check out https://imba.io for docs and more info :)

  • Compiles to Javascript, works with node + npm

  • DOM tags & styles as first-class citizens

  • Optional typing and deep TypeScript integration

  • Blazing-fast dev/build tools based on esbuild

  • Advanced tooling with refactoring++ across js,ts, and imba files

Hope you like it, and please share any feedback you might have in the comments!

80 Upvotes

33 comments sorted by

24

u/AlminCode Aug 16 '21

Why would I use Imba instead of TS?

17

u/sindreaars Aug 16 '21

So, TS is a generic web language just like JS. Imba is a very opinionated language specialized for developing web applications. Right now you should probably stick with TS due to the lack of documentation and traction for Imba, but we're working to resolve both of these issues rather asap ;)

7

u/AlminCode Aug 16 '21

but Imba is being compiled down to JS or is it directly interpreted in the browser?

Is the output JS human readable?

Really love seeing alternatives to JS to be honest..

12

u/sindreaars Aug 16 '21

Yep, it is being compiled down to js. Everything but the tag trees are actually compiled into very readable js - preserving comments and everything. The tag trees looks more like some obscure bytecode, but it is also insanely fast :P

1

u/AlminCode Aug 16 '21

Compiles to Javascript

Ok yeah.. first line on the website :D

18

u/youssarian Aug 16 '21

very opinionated language

opinionated in what way? my last experience with an opinionated framework/tool was angular 2+ and man i hated it. i'm a smart programmer i want to be able to do things my way. it shouldn't feel like i'm fighting the framework/language to get my work done

12

u/dAnjou Aug 16 '21

Sometimes the smart way is using a carefully evaluated opinionated tool in the way it's intended to be used rather than bluntly forcing a square peg in a round hole.

If it feels like you're fighting the tool you're probably using it wrong and should do more research to figure out how to do it right. Or the tool is simply not right for what you want to do.

In our current project we've introduced a rather opinionated backend framework which will allow us to scale a very particular, uncommon kind of workload. On top of that this framework is written in Scala which is new to us and arguably quite opinionated as well. Both are really powerful as well though, so it's worth a few more iterations to ultimately end up with a well-designed system with idiomatic code that's easy to reason about.

-4

u/bsenftner Aug 16 '21

Opinionated is a bad pattern to promote; it basically promotes secret knowledge to the backbone of how the software operates. Data driven architectures are fine, and good to great when engineered well, but taken to the level of being labeled Opinionated means the idea of data driving the creation of the software has been taken too far and unless there is integrated documentation detailing what going on under the hood, the tech workers using the system are blind and incapable of managing issues should they occur - all they do is put data in magic locations, and the system "sees it" and incorporates it into the final software. A recipe for creating technical dumdums.

5

u/dAnjou Aug 16 '21

I haven't downvoted you but I'm trying to explain why others probably did (even if they shouldn't have).

I think you are misunderstanding the term "opinionated" or you're conflating it with something else.

An opinionated framework or in this case language simply is one where you're supposed to follow a certain way of doing things as intended by the creators. And this way might differ from how you've done things before which means you need some discipline to not let muscle memory take over. Or it could mean that this way doesn't work for your use case but if you carefully evaluate the thing then it might save you a lot of time and headache.

But it doesn't necessarily mean that things are hidden.

1

u/bsenftner Aug 17 '21

They are not supposed to be hidden, but in practical usage too many companies developing with an opinionated mindset do not do documentation, the system is verbally communicated and internalized. Then at some point it is realized the documentation is severely lacking and then developers have to reverse how the system works, because key people that knew left who knows when?! In a well managed organization, practically anything is possible, but where are these well managed organizations? Few to nonexistent.

3

u/Ran4 Aug 16 '21

Looks really cool! But how do you define custom types?

3

u/sindreaars Aug 16 '21

If you want to define interfaces / plan types you currently need to create them in `.d.ts` files. Type-only definitions may be introduced in 2.1 or a later version :)

3

u/Ran4 Aug 16 '21

Since a large fraction of all code tends to be types, shouldn't that be a primary concern as it is intimately related to the syntax?

2

u/sindreaars Aug 16 '21

Well, the fraction clearly depends on which language you are using. JS is a very popular language where 0% of the code is types :P Imba started out just like that, but for v2 we added support for type annotations to improve intellisense and IDE behaviour. For our internal use - when we want to declare some strict types that are not naturally inferred by the tooling - using `.d.ts` files works well enough.

16

u/[deleted] Aug 16 '21 edited Aug 16 '21

It seems an interesting idea, and quite a mature product, but I think I'm somewhat skeptical of the premise.

Imba's time-saving syntax with built-in tags and styles results in less typing and switching files

A huge amount of time devs spend developing is not spent typing. I'm personally way more interested in code which is expressive, easy to read and easy to debug. Having a language which uses the fewest keystrokes in not a concern of mine. Making everything as concise as possible increases the burden on me to remember all the shorthands.

Is there debugger support for this? It seems like it is quite a significant abstraction over the generated javascript that I really can't see how a debugger would work effectively.

I see plenty of places where the website says "it's fast" relative to other frameworks but I don't see any concrete benchmarks or other proof of this. Do any exist?

You say you're YC-backed but how do you plan to monetize this?

Overall, seems like very strong progress. Good job!

9

u/balefrost Aug 16 '21

You say you're YC-backed but how do you plan to monetize this?

From OP's original post, it sounds like their actual business does something else; this is just the infrastructure that they've built to drive their actual projects.

17

u/balefrost Aug 16 '21

On one hand, given that this is /r/AskProgramming, I'm generally not a fan of people who post without actually asking a question. (In my mind, "feedback welcome" isn't an actual question.)

On the other hand, this is certainly an interesting project and you've clearly put a lot of time into it. As a "show and tell", it's really cool. It's fun to see a take on how to do web apps better, and this take is more than just a laboratory experiment. That's interesting.

And surprisingly, you didn't repost to all the programming-related subreddits - just /r/webdev, /r/javascript, and... /r/AskProgramming.

So now I gotta ask - why this subreddit?

2

u/Zardotab Aug 16 '21

If this is the incorrect sub-reddit, then what is the correct one? If there is no better match, then it's acceptable in my opinion to put in the closest match even if it's not an optimum title/category.

If Reddit hired a centralized Category Management Lord, then maybe it would be smoother. But Reddit leaves it semi-organic, meaning categories and rules have (at least) temporary rough spots.

3

u/knoam Aug 17 '21

r/ProgrammingLanguages is for people like OP working on developing their own PLs and talking shop.

3

u/Zardotab Aug 17 '21 edited Aug 17 '21

r/ProgrammingLanguages happens to be populated by those who enjoy "high brow" connoisseur programming and programming features that may not fly well in the real world, where staffing is unpredictable and teamwork matters heavily. It's hard to get practical "work day" feedback there.

1

u/[deleted] Aug 17 '21

0

u/balefrost Aug 17 '21

Let me be clear: I'm not trying to chase you away.

I think this subreddit works best when the discussion is around a specific question. The question might have a clear, unambiguous answer or it might be an open-ended and philosophical question - both are fine. I think it also helps when the question is more-or-less self-contained. I don't know how other people interact with this sub, but I tend to check periodically for questions that aren't getting any love or questions where I have very specific knowledge that can help.

To me, your "question" is just really really big. As you said, you've spent 7 years on this thing. Any insightful critique would similarly require a big time investment in order to make the critique meaningful.

I think it's interesting that several top-level comments are asking YOU about your language. I guess that's still a question, just very role-reversed for this sub.

Is there some aspect of your language where you want specific feedback? Is there something that's particularly novel? I think, if you could provide a more specific prompt, you might get more engaged discussion.

Again, I'm not trying to be a gatekeeper here. You're clearly interested in discussion, unlike some of the people who spam to 50 different subs (including this one) and then bounce. AskProgramming just seemed like a surprising choice to me.


Here are some other places that might be relevant:

/r/ProgrammingLanguages (there are plenty of language nerds that hang out there) /r/typescript (since it sounds like you have close interop) /r/programming ('cause why not shoot for the moon)

1

u/Zardotab Aug 17 '21 edited Aug 17 '21

Well I agree it's probably too much to chew for Reddit discussions. Maybe r/sindreaars can introduce the language and pick one allegedly wonderful feature every few months to highlight and discuss.

For example, I love optional named parameters and wonder why more languages don't have them. (C# and VB.Net are the most common examples.) Currently recommended "emulations" of them are half-ass, more code, and more rework per function signature change. If Imba doesn't have them, I have to summarily write it off. They are that important to me.

6

u/yel50 Aug 16 '21

I was hoping that by alternative you meant a browser extension that could use a different language and completely replace js, but no. yet another transpiler added to the mile long list. to be honest, it looks like coffeescript to me. except that coffeescript added language features and I don't notice any here.

6

u/marinac_1 Aug 16 '21

Soooo this is not a "JavaScript alternative" it's just a compiler?

PS: Had 7 years to create new language => didn't remove null smh

5

u/wgomg Aug 16 '21

Please don't advertise as an alternative to JavaScript when it is not.

2

u/Kattoor Aug 16 '21

Sure to give it a try, thanks for sharing!

2

u/[deleted] Aug 16 '21

Do I have to use the abbreviated terms in CSS? What if I prefer the full naming convention for sake of readability?

2

u/laserpistus Aug 16 '21

You are free to use the un-abbreviated terms if that is your preference.

1

u/[deleted] Aug 16 '21

What about elm?

1

u/MacASM Dec 30 '21

That seems a really interesting project.

0

u/Zardotab Aug 16 '21

You perhaps should have asked for feedback before you started, collected suggestions, listed alternatives in a pro/con format, and then have some kind of systematic and traceable ranking system to vote on features.