HNHacker News
TopNewBestAskShowJobs

belmont_sup

79 karma · joined June 16, 2022

submissionscomments
belmont_sup··on Programming culture in the late aughts (2022)
I can feel the raw anger and exasperation. Well done.
belmont_sup··on SwiftData
Figured you were questioning dogma, so I also wanted to continue the conversation explicitly.
belmont_sup··on SwiftData
Guess I’ll have to say it.

It maximizes the user market. https://iosref.com/ios-usage

Losing a potential 10% of your market share because they’re 2 versions away is unquestionable for some companies.

belmont_sup··on The Rust I wanted had no future
I agree that hiding coloring entirely is really a trap. I want to know when some IO work runs because it means potential exceptions unknown with unpredictable latency in my program.

As a design choice of OCaml’s eio - an async runtime, you must pass around a dependency to all your IO functions. With the “net” object passed visible in my function type signature, I can tell some network work may occur. The first benefit is we get synchronous Go-like code.

belmont_sup··on The Rust I wanted had no future
Yawar’s explained it all, but I’ll share tidbits of my own.

When reading ocaml on _text_ like from GitHub, I personally accept that I won’t need to know the type and underlying data structures just yet unless I read and have open the .mli file.

I’m excited first and foremost because we can have async code feel synchronous like Go.

How does the code run? IO runtime is defined in userland, like Rust’s Tokio. That’s the “Eio_main.run” part. Underneath, eio spins up and manages processes in a non blocking manner, even scheduling work.

Since effects are essentially resumable exceptions, this particular http request throws an effect to the runtime. The logic and this particular process pauses (okay I may be wrong here). Logic flow now continues somewhere in our runtime level (the effect handler), where all the async IO work happens. The runtime resumes the child process and returns the http result back to the child via a “delimited continuation”.

belmont_sup··on The Rust I wanted had no future
Algebraic effects like how OCaml’s now implementing it may be possible! The ecosystem around effects in OCaml is still really young, but here’s an example of an http request being made that is asynchronous, non-blocking but looks synchronous with no special syntax.

https://github.com/mirage/ocaml-cohttp/blob/16e991ec1f7e5f0c...

Performing these effects is similar to throwing exceptions up the callstack where whichever ancestor handles the IO work, then resumes the child with IO work done in hand.

belmont_sup··on Why is Kubernetes adoption so hard?
At this point, if it’s painful enough, why isn’t compiling-to-yml tools more popular?

Example: https://github.com/dhall-lang/dhall-kubernetes

Haven’t used dhall myself but I’d definitely prefer a DSL on top of yaml.

belmont_sup··on Why F# evangelism isn't working (2015)
Reminds me of https://lexi-lambda.github.io/blog/2020/01/19/no-dynamic-typ.... Always a fun revisit.
belmont_sup··on Americans have never been so unwilling to relocate for a new job
Seriously. Anyone only has to look for a second and see how many Americans are struggling day to day, paycheck by paycheck. Quick search says up to 78% of Americans do. That’s “essentially indentured servitude”.
belmont_sup··on Ask HN: What's your favorite GPT powered tool?
Here with you 3. I use the warp terminal. They integrated chatgpt into it. I almost never leave my terminal now if I need to search something quickly.

If I forget some api or technique in some language, I ask it. Depending on its results, I may or may not start browsing for more details or to verify.

belmont_sup··on Ask HN: I am overflowing with ideas but never finish anything
https://kern.al/ does this too, but if you want to do it, just do it and draw inspiration!
belmont_sup··on The Epic Stack
Having the simple CRUD apis for a table/model is super helpful though.

I use prisma, and then when it becomes too complex, or is annoying, switch to sql.

Sometimes I don’t want to have to manually deserialize rows into my objects (and yes, orms do this for us, and some non-orms do too).

belmont_sup··on The Epic Stack
For those that are using open source js software to build web applications and are able to pick apart and understand what each tool does, his choice of tools are actually tried and true.

Even a C# developer building with aspnet has to reach out to many of these tools: grafana, some hosting service, some log/error monitoring tool.

But at the same time, I think a lot of comments here are pointing at the glaring reminder of how obscenely complex development for the web can be in the JS ecosystem (for new or non-js devs). Why point new engs to remix, prisma, mailgun, insert 3rd party tool when it’s so much better to give them the Ruby on Rails approach? Aspnet, Ruby on Rails, and similar frameworks in all languages including JS frameworks incorporate nearly all the tools mentioned but without requiring someone to wire it up themselves (or to understand the wiring).

belmont_sup··on Incident with Issues and Pull Requests
Here’s one

https://www.wsj.com/articles/amazon-scooped-up-data-from-its...

The gist is that yes it’s true. They’d come out with their own Amazon Basics branded stuff and push it to the top.

belmont_sup··on Lambda Capabilities
I read the first statement as being able to do IO judiciously with a subset of IO work, e.g. network, filesystem.

The second is no IO.

belmont_sup··on My thoughts on OCaml
But you can always just try ocaml for the sake of it, for the fun of it!
belmont_sup··on My thoughts on OCaml
Syntax and sugar is subjective, right? Instead, easier to discuss the layer beneath syntax, and that’s to compare the type systems. Java now has some version of sum types aka algebraic data types, but because of its beginnings, it may never feel as easy to use. And ease of use is important, as is evident from discussions here.

Had to look up to see where Java is at for sum types. First link I found. https://sfietkonstantin.github.io/2021/09/03/Java-sum-type.h...

belmont_sup··on My thoughts on OCaml
If Ocaml fixes this and makes opam/dune play in the same field as cargo, life would be great as an ocaml programmer.

Sometimes I go back to F# and sigh because I can just print any complex data structure. Sure, there’re limits, but it’s just one less pain.

Regardless, really enjoy everything else. I cloned and built the Dune repo to try to help fix something. Compiled very quickly for its size.

belmont_sup··on PHP Popularity: Is it decreasing and what to do about it?
Handful of great new hosts I’ve seen pop up:

Render.com, Fly.io, northflank. And I actually like AWS lambdas, so great option for me is SST.dev, which wraps AWS CDK, and provides an actual live development workflow with actual AWS resources.

belmont_sup··on Why and how we retired Elm
The other way around is to point at great React based apps. Linear’s project management tool is so quick and fast. It takes a whole mindset embedded into a team to make a product fast from the get-go.
belmont_sup··on Gossip Glomers: Fly.io Distributed Systems Challenges
Isn’t based around Consul or etcd, but the encore folks https://encore.dev/docs have been building a framework that makes working with microservices much more straight forward.

I haven’t used it much, but the tool is able to generate all the code for services that want to speak to one another. This to me is enough service discovery.

belmont_sup··on Ask HN: What is the most barebone back end solution?
If you ask barebones, that's going to get so many different answers here because everyone will have their own definition and bias. If I inherited a small game that needs a backend, I'd pick any of those backend-as-a-service options. Supabase and Firebase comes to mind.

If you pick Supabase, it's Postgres with a web api and sdk on top. Then, sure you can serialize all the game state as a jsonb record. You don't even need to deal with authentication if you don't care about isolating games.

Free tier until you make money somehow and then pay the 25/mo.

belmont_sup··on ML Dialects and Haskell: SML, OCaml, F#, Haskell
I’m guessing you’ve referring to what https://caramel.run/ could’ve been?

I think Gleam is pretty good enough to get that typed feel on the BEAM.

belmont_sup··on Ask HN: How has functional programming influenced your thinking?
It’s all about handling state in a careful manner.

A helpful consequence of immutability is that it makes concurrent and parallel programming easier. Take Erlang/Elixir. The main reason it’s able to share state between processes so easily is because it completely copies values from one process into another’s mailbox. Compiler guarantees you don’t pass a reference. If it were the same memory, two processes could mutate and unwittingly break one another.

Another helpful aspect are the patterns of code you end up writing. It’s common in Node and C#, even Go, to pass a mutable context or stateful object with a bunch of hands reaching in to read and write. Because you can naturally do this, you naturally also tend to program like this. Cue data access issues again.

But if you guarantee immutability at the runtime level, it changes how you write code. You tend to write functions in a “transformer” / pipeline style. there’re great examples of open source codebases to read from that exhibit this. See a typical F#, Haskell, and presumably Scala web api codebase, and see how they handle state.

belmont_sup··on Ask HN: How has functional programming influenced your thinking?
I forgot where I read this, but I'll paraphrase: it's easier to work with 10 objects with 1000 applicable functions than with 1000 objects with 10 methods each.

In Haskell or other typed fp languages, you have all these well-recognized and well-used typeclasses and their attached methods, conceptually equivalent to generic interfaces in c#/java. It's easier to adapt new data structures into these interfaces and have all your existing functions immediately work with them.

The "mathematics" part here is that these typeclasses are backed by category theory that prescribes their behaviors.

There are plenty of random readings you can find, so I won't recommend them. Someone's bound to argue with me on what's a better entrypoint.

I do want to note that you don't need to use haskell or an fp language to use these concepts. Example: a complete set of fp data structures in typescript https://gcanti.github.io/fp-ts/modules/. It's just that fp languages make using them much easier because of their type system.

belmont_sup··on Ask HN: How did you become a “good enough” programmer?
If I’ve stepped away from the code a while, and come back later 1-2 months with new requirements, that sometimes requires me to rewrite a pattern or so.
belmont_sup··on Ask HN:Why did I fail to learn web development?
Like many others are hinting, you’re trying to learn the entire ecosystem of web dev, which is vast, in a haphazard way. A lot of tutorials and guides out there are terrible. They fail to teach the basics of web dev before teaching the abstractions. It takes learning both, just as learning geometry out of context is boring and inapplicable but learning how light waves work without understanding the math to talk about is probably difficult.

What I also recommend to others now is to skip the complexity of the front end ecosystem, and learn how the web operates from a server side point of view.

If you truly want to stick with react, I’d suggest using https://remix.run. They offer a react experience but forces you into a typical server-first mental model.

Or just learn Node and how to do things the node only way. Basic html forms. Cookies. Security involving forms. Database access. Rendering html with templates. These are basics that get so abstracted over by the modern web dev frameworks that it’s not surprised you’re distracted by something like react hooks.

belmont_sup··on Ask HN: Who’s using Ruby for web development, without Ruby on Rails?
I’d call Postgres “heavyweight” compared to SQLite. Maintaining a SQLite db is as simple as a file, and then you can use litefs or litestream to back it up.

Maintaining a Postgres server or cluster is hard. But it offers way more functionality.

I agree that the term heavyweight can mean many things to people. I’ve take it as a generic mix of maintenance, complexity of project, ease of use for your purposes.

belmont_sup··on What if writing tests was a joyful experience?
Seeing as how you prob can’t consolidate apis to a single process for more control.

Seriously, having an http mocking tool is so helpful. I use msw, a node equivalent of wiremock. To help with a situation like yours, it’s easy to say “before this executes, I want the mock tool to return this response”. The abstractions are good enough that I don’t have to deal with recreating my dep-injected service objects, and really reduces the tests’ lines of code. It also seems like the most complex bit here is handling your permutations of code paths, as well as their error paths. I salute. I can’t think of a way to simplify it all except to be glad I work on smaller products now that don’t require so many microservices or 3rd party apis.

The unfortunate bit is ensuring your mock stays up to date with their api. But if we have most or all of the variations, then it’s their fault for breaking their APIs on us, no?

belmont_sup··on Zoom, Teams, Slack Are Wreaking Havoc on Employee Productivity
Have you tried Slack's huddle feature? It entirely replaces Zoom for us now. However, Slack's screenshare capabilities are just not as robust.
← PreviousPage 2 of 4Next →