9 ms·
Imba – A friendly full-stack language
- hestefisk 3y agoLooks interesting. Has anyone used this for something “serious”?
- ashenke 3y agoIt was used for https://tasktxt.com https://tasktxt.com, a neat task manager / time tracker that I love
- alin23 3y agoWell it powers https://scrimba.com https://scrimba.com which looks serious enough. I’ve known about it for the past 6 years, but never had the chance to use it because I’ve only done static websites lately. I am starting work on an automatic irrigation system that will have a web/PWA frontend and I remembered about Imba which I plan to use this time.
- deleted 3y ago[deleted]
- ctenb 3y agoSeems novel. Does anyone know if any comparable technologies exist?
- alin23 3y agoI remember Opa http://opalang.org/ http://opalang.org/ tried something similar at the time when MongoDB was new and modern.
- Yoric 3y agoThose were the days :) I believe that we made a few mistakes with Opa, though. The slicer (the component of the compiler that decided which code should be compiled to client and whic hto server) was a great idea, but it came with considerable pitfalls in terms of security. Since then, I have concluded that too much multi-tier magic is actually a bad thing. If I were to start a new version of Opa, I would probably force developers to split their code manually between client, server, database and location-independent (presumably by putting stuff in distinct directories). This would be much easier to read/audit. But at this stage, this raises the question of whether an entirely new language is really useful. Why not simply do it with a sufficiently smart toolchain based on TypeScript or any language that compiles to wasm? Source: I did not start the project but I led the design and implementation.
- alin23 3y agoSmall world :) I love when these things happen! I still remember the sunny day I was at a Starbucks table with a huge americano and my first second-hand MacBook, stumbling upon Opa and thinking "what a great idea!". It looked so simple, intuitive, and the fact that I could write both front and back end in the same file was amazing! I never got to do a large project with it, so I didn't notice the pitfalls you are talking about. But I want to thank you and your team for making me understand that web dev does not have to be painful if you choose tools that you like.
- Yoric 3y agoThanks :) While I think that we made some mistakes in the design, I'm surprised that, to this day, there isn't any widely-used language/toolkit/framework [1] that seems to do as well. [1] Alright, there's GWT, which does pretty well with different tradeoffs. But for some reason, it seems to be extremely niche. The website mentions that "thousands of developers" use it.
- rlander 3y agoOpa was ahead of its time by at least 10 years. Have you seen Electric Clojure [0]? [0] https://github.com/hyperfiddle/electric https://github.com/hyperfiddle/electric
- Yoric 3y agoLooking at it right now, thanks!
- dustingetz 3y agoHey, we at Electric Clojure believe our model is secure, can you say more about the problems you encountered?
- Yoric 3y agoWell, it very much depends on your definition of "secure". The OWASP top 10 were pretty easy to eliminate entirely with a language that supports static analysis, but we accidentally introduced a couple more: 1. the model made it hard for the developer to know what data was flowing from the server to the client (e.g. are we leaking a secret as part of a closure?) 2. on the web, you can only (mostly) trust the code that's executed on the server, as the client could have been patched to be running arbitrary malicious code, but the syntax of Opa made it very easy to forget that some of the code was living in this client-side warzone, which in turn could lead to serious security vulnerabilities; 3. when you patch code, especially in auxiliary functions, it's easy to lose track of where it's going to be executed, which means that it's easy to accidentally add a secret leak/capability leak. We tried many things to reduce the problems, and eventually settled on removing most of the intelligence from the slicer, to make it more predictable, and replacing most of the slicer's tier inference with annotations, to make sure that the developers actually paid attention to the decision. I believe that this wasn't sufficient.
- Yahivin 3y agoCivet[1] is a similar idea for a programming language based off of TypeScript and 99% ES compatibility. [1]: https://civet.dev https://civet.dev
- franky47 3y agoSome of the syntactic sugar is very nice, but the overhead of transpiling that to TypeScript to get type checking, then to JS for runtime seems excessive.
- abdellah123 3y agoit's actually very old! Even older than React
- chpatrick 3y agoDo we really need more languages?
- alin23 3y agoDo you think in the year 2100 we'll still write Python and C? From that point of view, sounds like we should be happy with the status quo and not create anything more. Imagine if that was the case in 1991 when I'm sure someone else said "Do we really need Python and other languages? Isn't C, Lisp, Fortran enough?" We would have none of the nice ergonomics that current programming languages provide.
- chpatrick 3y agoI just think making a new language (and therefore new ecosystem) just to make slight changes to syntax is a total waste of time personally. Unless you really do something profoundly different in terms of type system, memory management etc, you're just making a new thing to learn and an extra nuisance to use if its toolchain sucks. "JavaScript but looks kind of different" doesn't clear that bar for me. We learned that from CoffeeScript. I don't have any problem with people making languages for fun but to me if you're asking people to deal with the hassle of a new language it better be for a good reason.
- alin23 3y agoI seem to haven't learned that yet, as I still use Coffeescript heavily and I'm happy it exists. It's only one data point, but if it makes even just a few people happy, it already has enough reasons to exist. > a new thing to learn and an extra nuisance to use if its toolchain sucks > if you're asking people to deal with the hassle of a new language it better be for a good reason I think the biggest confusion here is that you feel that someone is asking you to use the language, or that the creators of the language are pushing it in people's faces. Couldn't be further from the truth. The creators build a language for their project (Scrimba.com) and had the nice idea to share it with us. If we find it compelling, we are allowed to use it, give feedback, and contribute to its development if we want it to grow. I personally can only feel gratitude towards these people.
- aditya 3y agoPreviously: https://news.ycombinator.com/item?id=10091454 https://news.ycombinator.com/item?id=10091454 Imba was actually forked from CoffeeScript... hopefully, they've managed to avoid all the downsides.
- layer8 3y agoConfusingly, they seem to be using the term “tag” for what is really an HTML element or component. (E.g. “<div>…</div>” in HTML is not a tag, it’s an element delimited by one starting and one ending tag.)
- pard68 3y agoThis is a fairly common, and I believe correct, use of the word "tag". The MSDN reference uses the term in a similar manner (as do countless other definitive resources and tools). Consider the first sentence of the MSDN's page on HTML elements: > This page lists all the HTML elements, which are created using tags. -- https://developer.mozilla.org/en-US/docs/Web/HTML/Element https://developer.mozilla.org/en-US/docs/Web/HTML/Element The "tag" is the word between the "<" ">".
- layer8 3y agoYour quote doesn’t support your argument. Yes, elements are created out of tags (plus content). But a single tag generally does not constitute an element, except for self-closing tags like <br>. I agree that it’s a somewhat common mistake to refer to HTML elements as “tags”, but it’s unfortunate to bake that mistake into a language.
- lolinder 3y agoIf it's common enough it's no longer a mistake, it's just how the English language is. If everyone understands each other, then insisting on a "more correct" usage is just pedantry. Can you provide a concrete example of a case where this usage would be confusing?
- gremlinunderway 3y agoYou can't really have a "mistake" unless there's an authoritative source and standard that everyone agrees to use. Language evolves with use, and being really passionate about an idealized standard in your head doesn't somewhat materialize it as the "correct" way.
- carapace 3y agoBlank page with JS disabled.
- Alifatisk 3y agoHaven’t heard about Imba for years! Completely forgot about it.
- pier25 3y agoImba has so many cool ideas. Anyone knows how development is going with v2?
- laserpistus 3y agoIt is stable and features are done, but docs needs to be improved.
- pier25 3y agoWas partial hydration ever implemented?
- habosa 3y agoImba powers Scrimba which is an incredibly cool platform with interactive coding screencasts: https://scrimba.com/ https://scrimba.com/
- asicsp 3y agoWhich includes learning Imba: https://scrimba.com/learn/imba https://scrimba.com/learn/imba
- zelias 3y ago_"Is it imba, or do I suck?"_
- lofaszvanitt 3y ago[flagged]
- trafnar 3y agoI assume you are referring to the CSS shorthands Imba provides. Yes, they are controversial... and optional. These all work the same in imba: css div { background-color: red; display: flex; flex-direction: column; } div@hover {background-color:blue;} css div background-color: red display: flex flex-direction: column div@hover background-color: blue css div bgc:red @hover:blue d:vflex
- lofaszvanitt 3y agoThe problem is, once you offer the option, people gonna use it....
- abdellah123 3y agoI wonder why this didn't take off?! This is so much better than React or svelte, no state management, built-in tailwind and more concise and expressive!
- sesm 3y agoWhat do you mean by ‘no state management’ and why is it a good thing?
- trafnar 3y agoYou don't need any special state management tools like "stores" or "setState" you can just use regular variables. let count = 0 tag Counter <self @click=(count++)> "Count is: {count}" imba.mount <Counter>, document.body
- sesm 3y agoHow will it work if I put 2 counter components on one page? If it’s just using global variable for state then it will be shared between component. You can do the same thing in React, it’s just a bad idea. If it does some magic under the hood to convert regular variables into something different like Svelte pre-5.0 (which Svelte decided to make more explicit in 5.0), then could you point me to docs describing it, I’m curious which approach they took with this.
- abdellah123 3y agothe point is there is no need for "reactivity" constructs. Organize your "state" the way you want. tag App counter = 0 <self> <button @click=counter++> "{counter}" imba.mount <App> it doesn't have to be anything. You're free to organize your code as you wish: colocate, in a different file ... the compiler doesn't transform the variable in any way, nor does it track its "mutation", it "just" "rerenders" on every change. And it's super fast too!
- 3y ago
- p2hari 3y agoI did use Imba on some of my side projects. Easy to get most things up and kind of fun to work with. Has many cool ideas as some one pointed out.
- trafnar 3y agoI’ve been building all my projects with Imba for the past few years, I love it. - TaskTXT - Plain text todos and tasks with timers https://www.tasktxt.com https://www.tasktxt.com - ReadyRunner - GPT chat for desktop https://www.readyrunner.ai https://www.readyrunner.ai - Chonky Menu Re-Creation - Breakdown of a fancy menu UI https://www.nathanmanousos.com/posts/chonky-menu https://www.nathanmanousos.com/posts/chonky-menu I’ve made several videos about Imba too: - Building a counter in 49 seconds: https://www.youtube.com/watch?v=8XS5q9xhaMc https://www.youtube.com/watch?v=8XS5q9xhaMc - Video timeline UI: https://www.youtube.com/watch?v=GbKTEqmCAJM https://www.youtube.com/watch?v=GbKTEqmCAJM - All of my Imba videos here: https://www.youtube.com/playlist?list=PLYxkh3w952l5cwxYLcCsdymUhXDIiNuIC https://www.youtube.com/playlist?list=PLYxkh3w952l5cwxYLcCsd... I made the (free) official course on Scrimba: https://www.imba.io/learn/imba https://www.imba.io/learn/imba Which is also on YouTube: https://www.youtube.com/watch?v=8DcOgcCy7zs https://www.youtube.com/watch?v=8DcOgcCy7zs I understand that Imba is not appropriate for everyone and every project but I encourage you not to dismiss it. One are where it is clearly valuable is in building prototypes and side projects.
- sesm 3y agoIt seems that main focus of Imba is code compression. I wonder, at which point they decided that they need a new language for that. I’ve seen things similar to ‘d:hflex ja:center’ many times, and it was achieved by writing a component that translates short props into CSS. I wonder, if there is a popular React library of such components (the ones I’ve seen were internal).
- rlander 3y agoI feel like you missed the point of Imba. It's not solely focused on code compression (although that does appear to be a secondary objective). Instead, Imba is all about empowering developers to create declarative user interfaces without the typical complexities that often accompany such tasks, like dealing with reactivity, signals, custom directives, v-dom, and so on.
- sesm 3y agoIMO there is inherent complexity in the task of creating dynamic user interfaces and reactivity/signals/directives are different tools to deal with this complexity by imposing different mental model on top. In any case, if Imba offers a new approach it fails to communicate this on the landing page and focuses on code compression instead. To me it reads like Imba is a re-pack of status quo approach (React + Next.js) that focuses on compressed syntax. This is actually a good thing, I just wonder, whether a new language is necessary to achieve this.
- rlander 3y ago> if Imba offers a new approach it fails to communicate this on the landing page and focuses on code compression instead. Fair enough. While it does touch upon `memoized DOM`, you're correct; it might not be sufficient for readers to grasp the full implications unless they're well-versed in these kinds of libraries. For a deeper dive, you can check out this subpage: https://imba.io/guides/rendering https://imba.io/guides/rendering. BTW, I don't have any affiliation with this library whatsoever. > I just wonder, whether a new language is necessary to achieve this. To achieve compression, no. But to achieve DOM reconciliation without a v-dom, yes.
- dang 3y agoRelated. Others? Show HN: My free course for learning Imba - https://news.ycombinator.com/item?id=31493263 https://news.ycombinator.com/item?id=31493263 - May 2022 (14 comments) Show HN: Imba – I have spent 7 years creating a programming language for the web - https://news.ycombinator.com/item?id=28207662 https://news.ycombinator.com/item?id=28207662 - Aug 2021 (345 comments) Show HN: Imba 2.0 – The JavaScript Alternative by Scrimba (YC S20) - https://news.ycombinator.com/item?id=28196158 https://news.ycombinator.com/item?id=28196158 - Aug 2021 (5 comments) Imba – Create complex web apps with ease - https://news.ycombinator.com/item?id=20487972 https://news.ycombinator.com/item?id=20487972 - July 2019 (36 comments) Imba the new JavaScript based language having Python,Ruby inspired syntax - https://news.ycombinator.com/item?id=18487942 https://news.ycombinator.com/item?id=18487942 - Nov 2018 (3 comments) IMBA the new programming language for web apps - https://news.ycombinator.com/item?id=17505816 https://news.ycombinator.com/item?id=17505816 - July 2018 (2 comments) Imba – 10 times faster than React - https://news.ycombinator.com/item?id=14837231 https://news.ycombinator.com/item?id=14837231 - July 2017 (1 comment) Imba: A new programming language for web apps - https://news.ycombinator.com/item?id=10901054 https://news.ycombinator.com/item?id=10901054 - Jan 2016 (128 comments) Imba - create complex web apps with ease! - https://news.ycombinator.com/item?id=10863827 https://news.ycombinator.com/item?id=10863827 - Jan 2016 (8 comments) Imba – A new programming language for the web - https://news.ycombinator.com/item?id=10091454 https://news.ycombinator.com/item?id=10091454 - Aug 2015 (171 comments)
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- srhtftw 3y agoThis looks interesting. Can this be easily embedded? Could I let my users do some minor customization of my app by giving them an Imba editing window? Currently thinking about something like Workerbox https://news.ycombinator.com/item?id=33673047 https://news.ycombinator.com/item?id=33673047
- hackerdangluck 3y ago[dead]
- orliesaurus 3y agoThanks for sharing I was looking at something new to do tomorrow instead of taking time off
- fyzix 3y agoDoes it support SSG yet? This was a deal breaker for me when I assessed it a year ago.
- hyuuu 3y agoI wish haxe would invest into something like this
- ilrwbwrkhv 3y agoThe only web framework worth learning and getting into. 100x better than react, svelte and vue.