by torben-friis · 1y ago · 0 comments
After working with Node and Ruby for a while I really miss a static type system. - Typescript was limited by its option to allow non strictness.
Nothing catches my eye, as it’s either Java/.Net and its enterprisey companies or Go, which might not be old but feels like it is, by design. Rust sounds fun, but its usecases don’t align much with my background.
Any advice?
Some Fintech companies might go a bit outside the norm and allow for Haskell, F#, Scala, which they tend to use as DSLs for some workflows.
Then if you into array languages, banking and fintech is one fo the few domains where that have managed to stay around, but those positions seem hard to get.
Dyalog (APL), J, BQN, Kdb+ (Q)
The only issue is that some libraries (not many!) are still untyped, so you may need to write wrappers or stubs occasionally. But that applies to a small and decreasing minority of libraries.
I only wish Python were faster and had ahead-of-time binary compilation.
Since we are at it, faster as well.
And the type hints and behaviour are specified as part of Python, so it's kind of baked in. It's just that the actual type checker is not part of CPython, though Mypy is considered the reference implementation.
We have quite a large code base and very few `# type: ignore[code]` directives.
Some third party code still has poor type hints, but for the most part it's fine, and we get null safety which you don't get for Java.
I did that and highly recommend it, at least for new projects - not sure that it's worth the effort of porting an existing project, but ScalaJS just works and I found far fewer rough edges than I expected.
I played with it a long time ago and the IDE (eclipse plugin?) was a bit of a mess, sbt was prone to weird issues and lock ups and the compiler was pretty slow.
Very fun language tho!
Then they decided to focus the remaining effort on Scala Metals, which is based on LSP protocol.
In both cases it is alright for Scala 2, there are some rough edges for Scala 3.
Intellij tools are great.
But use the best tool for the job. Ecosystem matters. What are you planning to build?
But is it general audience? (can every Py/PHP/JS/TS/Java/C# dev become productive in it quickly?)
Also: if you want quick (re)compiles on a larger codebase, Rust is not for you.
Also: good you use Rust in teaching!
But I want a fast on-ramp, quick iterations and clean looking code. (and went with Kotlin because of that -- I like Rust more myself, but I have a business to run, so tradeoffs)
Let’s be honest , your realistic options for work are Java, C#, C++, and depending on the industry, Swift, Go, Kotlin, Dart and Rust.
I will hire the one that talks about the joy of FP and/or static typing ANYDAY over the programmer with only JS experience an no visible interest to look beyond.
Rust is also a general purpose language, there's no reason you can't use it for just about any problem space.
I guess when you're working at Jane Street, use only their core lib and you get some proper onboarding, things could work great. However you're programming very much in a niche community then.
You might have trouble finding small companies using anything but JS/Ruby/Python. These companies align more with velocity and cost of engineering, and not so much with performance. That's probably why the volume of interpreted languages is greater than that of "enterprisey" or "performance" languages.
What you get is either really old (Java 8 stuck on something nasty like weblogic).
Or companies running either cutting edge or LTS.
I've heard about Java initiatives to improve it, but can you point to examples of how how Java "is maturing into a syntactically nice language"?
I'm tempted to learn it, but wonder whether it would really become nice enough to become a 'go-to' language (over TS in my case)
Here are some actual improvements:
- Record classes
public record Point(int x, int y) { }
- Record patterns
record Person(String name, int age) { }
if (obj instanceof Person(String name, int age)) { System.out.println(name + " is " + age); }
- No longer needing to import base Java types - Automatic casting
if (obj instanceof String s) { // use s directly }
Don't get me wrong, I still find some aspects of the language frustrating:
- all pointers are nullable with support from annotation to lessen the pain
- the use of builder class functions (instead of named parameters like in other languages)
- having to define a type for everything (probably the best part of TS is inlining type declarations!)
But these are minor gripes
Also, a very wide-reaching standard library, good enough type system, and possibly the most advanced runtime with very good tooling.
Check jbang.dev, and then talks by its author Max Rydahl Andersen. That could be a starting point.
Typescript (via Deno) is still a better option IMO.
Sometimes I'm questioning if it has the potential to become more popular in the future if AI becomes adept at translating Python projects to Nim.
Zig, otoh might be worth another look.
That's 100% a project setting you can turn on or off though, it's like -Wall in C++ projects.
I'm also a back-end dev who's worked in fintech and IME, TypeScript is a great choice.
From my experience with python, none of its type checking libraries are complete enough.
I know, it’s just not realistically up to me. I depend on the team/company culture which I’d rather not have in the picture - I’ve already gone through trying to fight the sea of unknown/any.
As the OP, it’s not even the language for me but the implications of companies that use it.
It’s a non starter for startup/scaleups and strongly related with oldish companies and consulting firms, which in turn translates to far worse working conditions (not remote friendly, overtime, dress code, etc).
Mind that it might just be a local culture thing, your mileage may vary.
And it's a non-starter for startups, because it's not hyped enough, not for a technical reason.
Many of them would be way better off with a standard traditional Spring app.
I won’t deny there’s a lot of bad Java written, but IMO it’s actually one of the best languages for a startup if any of your code needs good performance.
mkay
Plus it's a fun language to write. Some people say it's a nicer, higher level Rust.
I also like the look of Kotlin but I've never used it. I think Kotlin and Swift are the two premier modern multi-paradigm languages.
I've since moved to Rust and have not looked back. Importantly, rust-analyzer runs circles around the Swift VSCode plugin (or Xcode for that matter)
It also needs to target GNU/Linux, because Apple got rid of their server offerings, thus anyone doing server code for applications on the Apple ecosystem, that wants to stay in a single language needs to be able to write such software on GNU/Linux with Swift.
Windows well, since they have the open source story, it kind of falls from there as complement.
On the revamped website they are quite clear about the identity.
Cloud Services, CLI and Embedded as the main targets for the open source version.
Though I must admit it's hard for me to imagine using anything other than Rust for 90% of projects.