10 ms·
Mint-lang: a language for the front-end web
- joshsharp 8y agoCool to see that this is written in Crystal.
- nedp 8y agoI'm glad that this project was written on Crystal. But does it tries to be like Elm?
- mjaniczek 8y agoThe author had been using Elm before (they're an author of elm-ui, for example), so maybe there's an inspiration?
- gdotdesign 8y agoThe author here, I was using Elm for a while invested a lot of time in it so there are parts of it that I like and that are parts that I don't. In a sense it tries to be like Elm: - good developer experience with nice error messages - single binary that have all the tools - enforcing types - no runtime exceptions is you don't use JS interop In an other sense it tries not to be like Elm: - JSX syntax with easy compose-ability - Straightforward JS interop - Decentralized and open package management
- SegFaultCDumped 8y agoDo we really need yet another language for the web?
- mariocesar 8y agoEvery alternative I know is based on Ecmascript, what other alternatives are?
- harlanji 8y agoClojureScript. Based on EDN.
- ckocagil 8y agoElm, ReasonML
- Vosporos 8y agoDart ! (Lol)
- jxub 8y agoPureScript (Haskell) and BuckleScript (OCaml).
- dom96 8y agoNim. I just finished developing a forum using the Karax SPA framework and it's been a great experience: https://github.com/nim-lang/nimforum https://github.com/nim-lang/nimforum.
- matthewmacleod 8y agoNo, we don’t “need” it. But how do you think progress is made? People come up with new techniques and tools all the time, based on their previous experiences with a platform. Sometimes these projects wither and die. Sometimes they find niches where they’re particularly useful. Sometimes they hang around with a core of dedicated users. Sometimes the ideas they introduce go on to influence other languages. Those are all beneficial. I’m surprised to see this same complaint levelled so often.
- perfectnsphere 8y agoI'm not sure what you mean by progress.
- sharpercoder 8y agoWe do need better languages, but we should get rid of languages that marginally improve. Take CoffeeScript: it pushed EcmaScript forward, but does not offer enough feature today to justify pouring enourmous man-hour resources into it. And this is true for many more languages (Flow, PureScript, LiveScript, IcedCoffeeScript, ...) which don't innovate on many aspects but just offer a slightly different - sometimes improved - syntax. I do recognize that many languages add value, but that must be offset to the cost of using these languages. Costs which are often quite high: Googleability, StackOverflowability, documentation, tooling, develop mindshare, library support, stability - these things don't come cheap and take years to mature. Furthermore, these "innovate slightly" languages in the webspace take away resources from improving the current state of the art in mainstream (EcmaScript, TypeScript, Dart, C#, Java, ...). For instance, instead of improving some JS tool now resources go into e.g. writing a language server for aforementioned language. A good example is Elm which does try to innovate on core concepts (builtin reactivity). That's a conceptual feature which can bring the state of the art of programming language design further. Last, I do not mean that we should not write any more new languages; but we should stop trying to get large-audience adoption for "innovate-slightly" languages. It's a waste of braincycles and actually hurts the ecosystem.
- tuukkah 8y agoPureScript is not JavaScript with a different syntax: it is a language with a full Hindley-Milner type system. "A strongly-typed functional programming language that compiles to JavaScript -- Build real-world applications using functional techniques and expressive types, such as: Algebraic data types and pattern matching; Row polymorphism and extensible records; Higher kinded types; Type classes with functional dependencies; Higher-rank polymorphism" http://www.purescript.org http://www.purescript.org
- tathougies 8y agoCame here to say this. PureScript has innovated enough to influence both Haskell and JavaScript. It is certainly a solid language in its own right
- mraison 8y ago
- laumars 8y agoI can see why they colour coded blocks. I think that project would have been unreadable otherwise. Which is ironic because even the worst of HTML with inlined CSS and JavaScript is more readable (albeit less maintainable).
- alexandernst 8y agoThis stinks as a masked React
- JasonFruit 8y agoHow about just biting the bullet and writing JavaScript? If I decided I wanted to use Delphi, but I didn't like Object Pascal, so I implemented a Scheme over the top that gave weird deep backtraces with wrong line numbers whenever an error occurred, compiled to a single-line semicolon-delimited mess of unidiomatic Pascal, and often required me to write some Pascal anyway, you'd think I was nuts. Why do we think it's a good idea just because it's in a browser? JavaScript has its problems, but it's far from the worst language out there. Just write JavaScript already.
- srgpqt 8y agoI think you just described ES6 compiled by Babel pretty well. Most people have gotten used to this disconnect.
- klodolph 8y agoWell, with Babel you at least have source maps so you can get the original source locations in your backtraces.
- Willamin 8y agoThere's nothing stopping other compile-to-javascript languages from having source maps too
- klodolph 8y agoYes, it’s a pretty standard feature which is why it works so well. You can Typescript->ES->bundled ES->bundled minified ES and Chrome will point you directly at the original source in the debugger (once you give it permission).
- innocentoldguy 8y agoOne of the benefits I've seen while using Elm is that you virtually never need browser-based backtraces. The Elm compiler catches everything and has much better error messages, in my opinion.
- ebbv 8y agoWorking on a project in Angular right now I’m really questioning if the layers of abstraction on front end code are worth the cost. The compile times and performance costs over writing standard JS are real.
- mg74 8y agoThe complexity and maintenance costs of developing a real-world application in standard JS are also real.
- tabs_masterrace 8y agoI would only consider something like Typescript mandatory, because static typing is just so hugely important for any maintainable project. But beyond that, it's a little more work to come up with a clean MVC pattern yourself, but also perfectly feasible to not use React/Angular/etc. Depends on scope and number of developers I guess.
- megaman22 8y agoOr you could design your application to not need all the bells and whistles and complicated shit that modern front-end web UIs throw in. 90% of pages could be static HTML. Probably 95% of "web applications" could be a set of forms with post-backs. If I'm trying to make a thick-client, I'd rather build it in a language and platform that I don't have to fight quite so much.
- mg74 8y agoHave you actually done it? I have, a team of 10 to 15 programmers building it for over an year (SPA, deployed on web, iOS and Android), and now I lead a team of 5 programmers maintaining it and developing new features. I will gladly pay the cost of a good abstraction for lower complexity.
- megaman22 8y agoYes, I actually have. A plain old-school Razor view UI with post-backs was infinitely easier to maintain than the cobbled together mess of javascript that we've ended up with trying to move away from that old, unsexy technology. And almost everything is an order of magnitude harder to do, or to make changes to.
- herbst 8y agoJust a empty white page on my phone.
- igotsideas 8y agoSame. Refreshing though.
- Willamin 8y agoYou'll need to have Javascript enabled to see the page. Mint's website is written in Mint, which is a compile-to-javascript front-end language that "tries to solve most common issues of Single Page Applications".
- herbst 8y agoI have. Using Opera mobile tho.
- cprecioso 8y agoFor the ones who want to get (a similar) developer experience while coding actual JS(X): you can use `react` together with `mobx` to the same effect. Additionally, take a look at `mobx-state-tree` to get more structured code. And of course, there's Elm if you want to get a completely different thing.
- desireco42 8y agoElm, Elm, Elm!
- fbonetti 8y agoElm is extremely opinionated and bottlenecked by one person. It’s great for the specific usecases it was designed for, but it gets tedious once you start interacting with external code and the outside world. The development cycle is slow and communication from the dev team is sparse. Some would argue that the slow deliberate, development pace is a good thing, but I was personally turned off by the fact that compiler bugs (and even documentation spelling mistakes) would stay open for months or years. I know somebody is going to jump in and tell me I’m wrong, that they’re using Elm in production and it’s the best, etc. This is my personal experience from using Elm on several side projects and also in production at my last job.
- kungtotte 8y agoIf your opinion lines up with whatever opinionated tool you use, you won't experience friction and will perceive the tool as aiding your work. It's not rocket surgery. It was the same thing when Ruby on Rails hit it big; some people swore by it and others detested it. It's like having a car that will only turn left, as long as you need to go left the car is perfect for you.
- desireco42 8y agoI appreciate you sharing your experience. I think point you raised are valid. Elm works for me and makes me happy. I couldn't ask for more. Any perceived slowness in initial development is gained later by very solid foundation on which I work. Again, all you said is true.
- sriku 8y agoWhat I would really like is for JS to have a good macro system so I don't have to subscribe to the two caste hierarchy of language creator and language user. Sweet.js [1] did it for me initially as cspjs[2] had async, await and more years before ... but I never found the time to ramp up to the updated version sadly so I can't comment on its state now. [1] https://www.sweetjs.org/ https://www.sweetjs.org/ [2] https://gitHub.com/srikumarks/cspjs https://gitHub.com/srikumarks/cspjs
- Willamin 8y agoThe two caste hierarchy is my biggest issue with Golang. Macro capability exists in Golang, but only for the upper caste of language creators. It makes me feel like the language creators of Golang purposefully decide that users of the language aren’t smart.
- dom96 8y agoYou might be interested in trying out Nim. It's a language that empowers the user, giving access to AST macros, compile-time function execution and generics. I would say that using Nim's metaprogramming capabilities to create a great SPA framework is a better direction than creating a brand new language.
- captainbland 8y agoI'd second this, especially since Nim has already got decent server-side capabilities as well means you can write an isometric web application where the server-side is written in a language with performance comparable to C.
- klibertp 8y agoMy only gripe with Nim is, as usual with non-mainstream languages, lack of libraries and frameworks (and lack of polish in the ones that exist, like Jester). The language itself is good and it's still evolving, so it has a chance of getting even better. BTW: I've read your book, great job! The "Advanced concepts" part was a bit too short (I'd gladly trade some of the earlier chapters for more examples of both FFI and metaprogramming), but I generally enjoyed the book. Also, I like how the code listings are annotated - how did you generate them? Is there some software specifically for this, or did you have to position all the arrows and lines and text manually?
- desireco42 8y agoI don't think I can make up my mind over small example. I don't think it is bad it is using patterns from React or Mobx as they are well known and it can help us think about development. Syntax is not such that I am immediately sold, but also not put off. What I didn't see is some performance promise like Elm, or simplicity, where it make sense to use this over anything else. I think it is good that a lot of people are thinking about languages and how to improve development, not everything has to be ground breaking. I will keep an eye for future work and how it develops.
- gdotdesign 8y agoThank you for this comment! It really helps a lot to get decent feedback. > What I didn't see is some performance promise like Elm, or simplicity, where it make sense to use this over anything else. I was focusing on the example, it seems I should really put up more information about this on the website, but to answer for this is basically: - it uses React under the hood meaning you have the same performance, the devtools works the same, it is possible (with some work) to use components from Mint in React and vice versa. - the error messages are really nice (there 281 unique error messages overall) both for syntax errors and type errors - easy JS interop using backticks - no import statements - fast compile times (the website compiles around 1 second) - single binary with all the tools included (development server, production builder, favicon generator, test runner)
- captainbland 8y agoWeb languages seem to be the new web frameworks for JavaScript - in the sense that there seem to be more and more of them coming out all the time.
- wruza 8y ago>The else branch must be present, if it's missing you will get a syntax error this is to make sure that all of the possibilities are covered Is there itsokay statement to pacify the compiler more?
- always_good 8y agoIf if/else is an expression, what would be the return type of `if (true) { 42 }`?
- klibertp 8y agoint option which is basically a variant/union like this: Result of 'a | Void You could also have a `discard` or `ignore` function/operator, which can swallow every type, so it doesn't matter what it was. Some languages actually require you to use such operators, for example, Nim and F#.
- carapace 8y agoBlank page with JS disabled. "Nothing to see here." literally.
- mathgladiator 8y agoThis is really cool, and I did something very similar (more hackish) ten years ago. This is a very powerful technique, and I wish the mint team the best. The downside is really a combination of building a community and educating people about it; this is where I failed along with SEO.
- gdotdesign 8y ago> The downside is really a combination of building a community and educating people about it Yes, this is what I'm worried about. I'm still tweaking a lot of things and I wanted to share it with HN when I thought it was ready, but on the other hand it's a nice that it got some attention already. I hope there will be enough interest over time to actually build up a community.
- faaq 8y agoAwesome!!!
- perfectnsphere 8y agoWhy do you think it's awesome? It's just another zealous implementation of some guys unearned and unfounded ideology. You know you can write the same thing with regular JavaScript and cut out the middle-man.
- jack9 8y agoA polyglot is harder to reason about than a single language, due to social concerns. Mostly this is due to the efficiency of singular concern and custodianship as opposed to disjointed languages with their own.
- ravernkoh 8y agoThis looks awesome!
- gdotdesign 8y agoAuthor here, please keep in mind that Mint is still very young and I'm still working to get things in order for a first stable-ish release (there are a lot of documentation to write and lot of cleanup work)