4 ms·
I should have mentioned in the message, but I was looking for a strongly typed language. I was an avid-user of dynamically-typed languages, but that particular
by raphinou 2y ago
I should have mentioned in the message, but I was looking for a strongly typed language.
I was an avid-user of dynamically-typed languages, but that particular Ruby on Rails app became unmaintainable, and part of the culprit was due to the dynamic typing. I hoped that using a statically typed language would make it easier to maintain a complex app in the long term.
And I must say that it totally materialised, to the point that I don't want to develop in dynamically typed languages anymore.
Here's an example: as I said in my original message, I was a complete stranger to the dotnet ecosystem, and I learned the F# language at the same time. And I decided to develop the app as a library project to be used by the web app. I completely missed the prevalence of the async approach in the dotnet, and all my code was synchronous. One day, about half-way in the project, I realised I needed to switch to async code. Had this happened in a dynamically typed project, it would have been hell for me. Maybe it's me that can't grasp a project well enough, but I need the type-guardrails to find my way in large refactorings. And with the strong types, large refactorings can be done confidently. They don't replace tests, but make the refactoring process much more smooth.
The app is open source and its code is at: https://gitlab.com/myowndb/myowndb https://gitlab.com/myowndb/myowndb
It doesn't have a lot of users, not the least due to lack of marketing and polishing the user experience. But I am satisfied of what I learned developing it!
- tasuki 2y agoThese days there's Gleam[0], as a strongly typed alternative for the BEAM virtual machine. Of all the languages I haven't used yet, it seems to hit the safe + minimalistic + productive sweet spot the best. (Yes the C-inspired syntax is slightly off-putting, but syntax is the least important aspect of a language.) [0]: https://gleam.run/ https://gleam.run/
- raphinou 2y agoI am also keeping an eye on gleam! I also regret that they left the ml syntax behind, but as you say it shouldn't be a blocking factor. If they adopt computation expressions and make otp a priority it would probably come beside fsharp in my toolbox!
- neonsunset 2y agoGleam, much like any language which primarily targets BEAM, is slower by an order of magnitude or two when compared to F#.
- no_wizard 2y agoThe appeal is the runtime model. I can’t readily verify if BEAM languages are meaningfully slower or really slower at all but let’s take the premise for the sake of argument. Even if is slower, the runtime model is incredibly resilient and it’s cheap to scale up and down, easy to hot update, and generally does asynchronous work extremely well across a lot of different processes. F# has really good async ergonomics but it doesn’t have the same task/processing flexibility and Websockets are kind of a pain compared to elixir or even erlang
- CharlieDigital 2y ago.NET's SignalR is actually quite good. Strongly typed message hubs on the server[0]. Wide client support. Azure SignalR[1] if you don't want to own the infrastructure to scale web sockets. [0] https://learn.microsoft.com/en-us/aspnet/core/signalr/hubs?view=aspnetcore-9.0#strongly-typed-hubs https://learn.microsoft.com/en-us/aspnet/core/signalr/hubs?v... [1] https://azure.microsoft.com/en-us/products/signalr-service https://azure.microsoft.com/en-us/products/signalr-service
- no_wizard 2y agogiven this is about F#, the question is how ergonomic is it to use this in F#? In the past, I found it wonky
- davydog187 2y agoFor most of the workloads you’re putting on the BEAM, they are IO bound and this is not of any consequence
- DonaldPShimoda 2y agoThis is a really minor point, but "strongly typed" and "statically typed" are not interchangeable terms. In the context of your comments here, you are exclusively interested in the static nature of the type system, rather than anything about the "strength" of it (which is something totally different and inconsistently defined).
- raphinou 2y agoYou are absolutely right. Thanks for pointing it out.
- DonaldPShimoda 2y agoSure thing. Cheers!
- throwaway2037 2y agoCan you explain more about strongly typed vs statically typed?
- baq 2y agostrong typing: 2 + "2" is an error (e.g. Python vs JS) static typing: 2 + "2" does not compile/parse (e.g. Python vs mypy, Typescript vs JS) this is a very simplistic example, but should get you to feel the difference.
- hoseja 2y agoweak typing: 2 + "2" is 22
- RUnconcerned 2y agocould also be "4" or 4! 4 seems like it would be the most evil option, honestly
- 2y ago
- asadbeksindar 2y agoHey, thank you for sharing your app's source code. I'll definitely check it out, I was really looking for such apps on F# open source projects!