7 ms·
Building a hybrid native application with Gleam and Tauri
- anentropic 3y agoFYI Celcius -> Celsius https://en.wikipedia.org/wiki/Celsius https://en.wikipedia.org/wiki/Celsius
- wezm 3y agoAhh whoops. Will fix in the morning, thanks. Edit: fixed now (might take a few mins for the cache to expire).
- jasonjmcghee 3y agoHeads up, the link to the code repository at the top of the post 404d for me.
- manusachi 3y agoFor those who is interested, as mentioned in the article, Gleam is already near v1 (v1.0.0-rc2)! And in a recent talk[1] Louis shared the idea, that there won't be major changes to the language anymore, and the main focus now is switching to the tooling! https://www.youtube.com/watch?v=clsTrQUt-4M https://www.youtube.com/watch?v=clsTrQUt-4M
- dcre 3y agoRecently learned about Gleam and am very interested in it as someone who always wanted to like Elixir but dislikes the Ruby syntax and lack of static typing. Love this approach to demonstrating the language in context. As a mostly frontend dev I feel it’s worth mentioning that while it’s a nice way to try Gleam, the Gleam aspect of this is inessential, TypeScript is quite good, and using create-tauri-app with the react-ts, vue-ts, or svelte-ts preset is also a great way to try making cross-platform GUIs with Tauri. It uses Vite under the hood, and the generated app is extremely minimal — nothing like the awful create-react-app behemoths that probably left a bad taste in everyone’s mouth.
- wezm 3y ago> the Gleam aspect of this is inessential, TypeScript is quite good TypeScript can be quite productive but I find its type system lacking. Specifically the use of structural typing/lack of nominal typing and lack of sum types. I find these extremely useful when writing reliable software, which is why Gleam appeals to me.
- dcre 3y agoIt has sum types! Type unions with a discriminator.
- wezm 3y agoIt kinda does if https://www.typescriptlang.org/play#example/discriminate-types https://www.typescriptlang.org/play#example/discriminate-typ... is what you're referring to but it appears to be missing one of the major benefits: an error/warning if you haven't handled all variants. Edit: lots of replies showing how TypeScript can be made to do exhaustiveness checking. It's neat and all but it's a lot of gymnastics compared to languages that just have this built in, which again is part of the appeal of Gleam for me.
- superice 3y agoOh that’s easy to fake with type narrowing: function expectType<A, B extends A>() {} expectType<never, typeof yourUnion>(); The function call will fail at compile time if yourUnion is anything more than never, which you can use in your else case of if statements that narrow the discriminated union.
- brigadier132 3y agoOh wow, I did not know they developed a js backend for it.
- endigma 3y agoYou should disable overflow scroll for your code blocks its bad UX on mobile to get scroll trapped in a code block (iOS/Safari)