Which languages do you reach for most often (whatever the reason for doing so)?
375 karma · joined September 16, 2023
Which languages do you reach for most often (whatever the reason for doing so)?
Some questions for you:
Would you say every programming language is fungible? If so, then why are there so many? How many should there be?
The recommendation to look for Haskell shops is exactly a heuristic for the thing you recommend:
> "work at a place that has problems that are deep enough to warrant deep dives."
There are many ways to find such places. Filtering by tech stack is one possible way of many to search for signal.
If you do want to eventually get a role using Haskell (which are rare), it is a good strategy to pick some commercial thing and implement it in Haskell. For instance, do a CRUD app using a postgresql app like Esqueleto/Persistent, Opaleye, etc. Or make a web app with Yesod (or even Scotty or Servant).
As for benefits, I get the following:
- strong, static typing via the Hindley-Milner type system
That means any changes to my logic and type signatures have to be addressed immediately everywhere.
- type-safe, composable everything
I want as many issues as possible to be caught at compile time. Ideally, I would have no runtime errors. It is possible to get close to this ideal with Haskell.
- terse, expressive language
Less code to read per concept expressed plus a strong type system means that maintenance and refactoring is a breeze. In fact, I can fearlessly refactor. That means once I get everything up and running, the codebase is stable even when I change things. Thus, I can actually focus more on the product and customer needs.
Combining all of the above with other stable and maintainable technology choices makes the entire app architecture easy to maintain over time as well.
You always have to consider the technology so you can properly architect your application and its dependencies.
I'm actually just starting my own company using Haskell so I can think deeply about what I want while making the product how I want.
LSP integration works as well as a given language engine has implemented it. I’ve got an autocmd group that automatically binds keys if that language’s corresponding LSP compiler is on my system. So with something like Rust or Go, I open the file and just go (no pun intended).
When I am trying out a new language, I just add a few configuration lines to my vimrc and all the bindings work automatically.
For non-LSP langs (or those with heavy servers) I use good ol’ ctags and grep, which is my preference anyway.
vim has been rock-solid for a while now and I can count on it not to break (or to break my configs!). I think very carefully about my workflows over time and deliberately configure the editor for exactly how I actually use it.
- "Designing better file organization around tags not hierarchies" [1]
- `tag` - a macOS version of `tmsu` that uses the system tags (xattr-based if I recall) [2]
[1] https://www.nayuki.io/page/designing-better-file-organizatio...
A foundational fact by definition does not need to be constantly scrutinized as if it were not. Rather it is something that can be relied upon stably until such a time that a change in a core assumption forces us to reevaluate the foundation if and when that scenario occurs.
Tools like htmx make it easier for solo founders and small teams who don't have the bandwidth or the desire to manage all the churn. Keep the dependencies tight and ship!
- https://github.com/xave/modern-c-vim-dev-env
- https://github.com/xave/modern-c-vimspector-debugger-tutoria...
Otherwise, the suggestions in this thread so far are great.
While I see the merit in his arguments, I believe his approach to data is "Clojure-like" or Lisp-like, in that it discourages explicit enumeration of all states and their possible configurations for the tradeoff of being able to sculpt these records. But, as a Haskell dev, I do not want to sculpt the records in the way he describes. I want to explicitly enumerate all the possibilities. This is, in my mind, a difference in cognitive preference. There is no right or wrong way and I think what he proposes is elegant. It is ultimately a matter of up front reasoning about the space compared with reaching a synthesis of the problem domain over time through wrestling with the problem itself. It is a statement about the efficacy of saying what can be known up front and to what extent, how much accuracy, and what utility.
I am about to launch a SaaS that pairs languages to these cognitive patterns as explicit understanding of such information can help bring together people who think similarly about information (team-building) while also opening up the possibility of expanding ones insights with alternative ideas and approaches (as his talk has done for me). The intent is to help hiring teams find devs that match their culture's programming and problem solving styles (whether that be reinforcing or doubling down on ways of thinking and acting).
Some software, such as Matlab, have those letters reserved for the common case of imaginary roots of a polynomial, and “ii” and “jj” as variables is a common coding convention. Whether “i” or “j” is your letter for imaginary numbers depends on if you’re an electrical engineer or not.
The idea is that the techniques that work for a worst case setup where you have the least control of log message formatting will work for most every other logging strategy (e.g. apps where the team completely controls the logs, don’t have to worry about kernel panics, etc.)
For instance one could imagine instead of writing logs to the OS kernel as the essay suggests, that one instead writes to RAM or something like Redis. In fact, writing to RAM is a strategy that many teams have found success with.
I like it better than the ormolu family because it respects your placement of comments and just formats the code itself. But it isn’t maintained as of a few years ago.
It is. Haskell has the low verbosity of scripting languages like Ruby and Python while letting you manage applications that would otherwise be written in high verbosity languages like C++, Java, and Rust.
I'm not using Haskell because it's bleeding edge.
I use it because it is advanced enough and practical enough. It's at a good balanced spot now to do practical things while tapping into some of the advances in programming language theory.
The compiler and the build system have gotten a lot more stable over the past several years. The libraries for most production-type activities have gotten a lot more mature.
And I get all of the above plus strong type safety and composability, which helps me maintain applications in a way that I find satisfactory. For someone who aims to be pragmatic with a hint of scholarliness, Haskell is great.
So if you go ad-driven, yes it will be nice and minimal ads at first. And the search will be amazing. But then one day, it won't. And that's an axiom.
Maybe that's the only way. People can get their value in the now from the search engine for 15 years or so. And then another graycat can make the thing to break the market at that point.
You could use something like Yesod or even IHP (and that's batteries included). There is Servant, Spock, Scotty for lighter weight than those. There's also the newer hastl (haven't tried it). Yet if you are using htmx, you probably want to keep things simple. On the one hand, there is simplicity from having a framework already together for you. On the other hand you can get that simplicity from only having the dependencies that you actually want for your needs.
You need something to handle:
- server connection (everything is built on top of wai and warp). There's servant and scotty for lightweight layers on top of wai (which uses simple HTTP requests and responses)
- database persistence (for postgres - Persistent/Esqueleto, postgres-simple, hasql, Opaleye, etc.; for sqlite there is sqlite-simple)
- html templates (optional, but it does make writing html more convenient. blaze, lucid2)
- auth (server-session, client-session, or roll your own. Of course, stuff like Yesod gives you all of this out of the box)
- sessions (most people roll their own Session module. The reason is that it tends to be dependent on your database and other decisions you have made for routing, connections, etc.)
- routing (libs like Servant and Yesod come with routing out of the box. Of course, you could just route with strings, but why are you using Haskell if you don't want type-safe routes? There's also stuff like web-inv-routes that give you type-safe, composable routes.)
Ultimately, I think the best way to go down the bespoke path is to know what functionalities a web server/web app needs to have as far as categories like the above and then to build it up one piece at a time (maybe with side exploratory proof of concept mini-projects). If you don't have time for that, I'd just use one of the frameworks so you can ship.
What I did not see from any of the responses is what did you do instead? Exercising did not work. What did you do? At least the people positing exercise as an answer gave an actionable response. And it does work. Nothing works for everyone.