Hacker Newsnew | past | comments | ask | show | jobs | submit | more packetlost's commentslogin

As someone who up until recently would have agreed with you, both of these are fundamentally familiarity issues. Nix's error messages really aren't that bad, but chances are there's exactly one line out of 200 that tells you what's wrong. Learning to read stack traces for a new language is part of learning that language.

I've not had issues with Nix APIs, at least not Nixpkgs or the language builtins. When something does break for me, it's usually some random JavaScript package that had some external dependency change. Nixpkgs is pretty well organized and I find navigating it not that hard once you read the packaging guidelines. find / fzf / ripgep / etc. are all great at this, as file and folder names are critical to the organization of nixpkgs.

The big turning point for me was trying to build and package a non-trivial application and build a NixOS module for it.


Package errors aren't that bad, but NixOS config errors are a nightmare because they are often a value that was computed from a value that was computed from what you wrote triggering a missing field, class mismatch, or infinite recursion in very generic framework code.


I think it's possible to write correct systems with dynamic languages, just not the ones we commonly use like Python and JavaScript. I find Clojure, for example to be one example of a dynamic language that is pretty easy to manage and I attribute that to the immutable nature and data-centric ethos. I'm sure there are other dynamic languages that would work as well.

Now, I wouldn't necessarily use Clojure on a huge multi-organization codebase (maybe it's fine, this is outside of my experience with it), but it can be the right tool for some jobs.


Common Lisp as well. I can’t explain why, but type errors are just not something I struggle with in Common Lisp! But it is in JS and Python for sure. Maybe someone knows why it feels different?


I think it’s cause there’s less imperative code and side effects to track data transformations through.

Like any random JS/php app is probably a huge pile of loops and if statements. To track what happens to the data, you need to run the whole program in your head. “And now it adds that property to the object in the outer scope, and now that object gets sorted, now it hits the database… ok…”. Whereas in clojure most functions are either a single atomic transformation to a set of data, or batch of side effects. You still have to run it through your head, but you can do it more piece-by-piece instead of having to understand a 1,000 method with class states being auto loaded and mutated all over the place. Also you have a REPL to try stuff out as you go.

Dont get me wrong, I LOVE static types. Statically typed clojure would be the best fckin language ever. But there is definitely a wide gulf between a dynamic language like JS, and one like clojure!


> Statically typed clojure

Well, if you also like Common Lisp, there's Coalton, which is Common Lisp with a Haskell-like type system: https://coalton-lang.github.io/


> Like any random JS/php app is probably a huge pile of loops and if statements. To track what happens to the data, you need to run the whole program in your head. “And now it adds that property to the object in the outer scope, and now that object gets sorted, now it hits the database… ok…”. Whereas in clojure most functions are either a single atomic transformation to a set of data, or batch of side effects. You still have to run it through your head, but you can do it more piece-by-piece instead of having to understand a 1,000 method with class states being auto loaded and mutated all over the place. Also you have a REPL to try stuff out as you go.

Nothing really forces you to write imperative code in a large fraction of cases, and typically the state-change operations can be quite localized within the code. And of course JavaScript and Python both also have REPLs.


But nothing forces you to write functional code either. I’ve seen a whooole lot of php and JS, and most of it has been pretty terrible lol. Of course you can write terrible code in any language, but I think the ease of starting with JS/php combined with the lack of built-in opinions makes it easy to build huge piles of spaghetti.

Though these days fresh typescript codebases are usually pretty decent. I love typescript and it’s really nice to work with a well-typed, modern project with proper schema validation and such. Def miss that in clojure.

Also I wouldn’t really compare JS or pythons REPL to clojure’s. Python’s is useful, but I pretty much live inside the clojure repl


I haven't done much with CL so I can only speculate, but I think stricter FP principles in general work to minimize the downsides of dynamic typing. CL, to my understanding, isn't the most "pure" when it comes to FP, but does a good job at giving the programmer a lot of power to constrain and explore systems.


fsync on most OSes lie to some degree


You probably overestimate the market for something like that. Most people don't know or care. Those that do are more likely to hang out on HN or adjacent places and know how to deal with it themselves anyways.


I have absolutely nothing good to say about Pulumi. Stay far, far away.


My experience with Pulumi is you can write bad pulumi code and good pulumi code and just like everything else, it's easy to end up in a codebase where one poor soul was tasked with writing it all and they didn't do the best job with it.


Please expand on your experiences, because I've had great luck with Pulumi at my company since October 2021. No engineer liked HCL, our demographic was engineers who were familiar with programming languages who wanted to self service basic infrastructure (AWS SecretsManager, IRSA roles, Databricks Service Principals, etc). We were pretty easily able to shim in a RunAtlantis inspired system that displayed previews that required explicit approval when a PR was raised, performed apply on merge to main, and ran drift checks periodically.


Their stack builds a lot of abstractions on top of each other and this works only well as long as you don't deviate from the beaten path.

One example:

You can't really build custom TS providers for AWS resources.

Why?

Because this feature is built using the compilation magic that makes inline lambdas work.

But the compilation step omits the AWS SDKs since these are present in a lambda anyways. So you can't use the AWS SDK in custom providers.


For me, the ideal is each team owns its own config/lifecycle mgmt, and does it in the language they wrote the rest of the system in.


Why? I’ve had nothing but good experiences, but I don’t run it and the team that does is extremely competent


Strange, I have a lot of good things to say about both it and Terraform.

Probably some specifics might be more useful there...


My experience is that by stealing providers from Terraform, they failed to properly handle statically typed languages (Go) with certain providers (HCloud); I had problems with their ID type and had to abandon my Pulumi setup.


Have a look at https://github.com/purpleidea/mgmt/ and tell me what you think. We don't have enough docs though. Tough being an open source thing that you want to keep open.


Running SST with Pulumi and it's been a great experience. Infrastructure and maintenance has been pleasant and SST's pre-fabs really make things easy to spin up resources.


please expand on this, I am interested (for real!)


I have both a Kindle Colorsoft (1st gen) and whatever the latest gen Paperwhite is and there's a noticeable contrast difference, but not nearly as bad as shown in that image. I find lack of sharpness to be more of a problem for very small fonts than the contrast.

I actively use both. I toyed with getting a Scribe because I read a lot of full size PDFs which aren't a great experience with such low refresh rates and small screens, but opted for an iPad instead. I owned a ReMarkable 2 a few years ago and don't really have anything good to say about it.


But... you don't have to use the new tools? The tools that ship with POSIX haven't meaningfully changed since like 2001 and work just fine today.


Smart contracts are actually pretty cool, but the entire ecosystem is made dramatically worse by the tokens having speculative value. It’s necessary for the economics to work out, but it dampens the coolness of the technical aspects because it attracts sleazeballs and enables fraud/crime.


The "worse" part about it is due to our society and what motivates people to do work. It has little to do with the technology and just a reflection of reality.

I think you get that, but I don't see another way to create a high performance trustless network.


Yeah, I see it as a necessary evil. It costs real money to operate the infrastructure that it runs on. I'm hoping now that the hype has died down a lot the swindlers will move on and real use cases will start showing up.


Not that Scala.


This predates that. It's written in Ada.


> This predates that. It's written in Ada.

Does it count if, combining the two, one could infer a musical scale[0] such as:

  Ada (ay-dah), Scala (ska-lah)
Bonus points for Latin aficionados:

  The word "scale" originates from the Latin scala,
  which literally means "ladder".
:-)

0 - https://en.wikipedia.org/wiki/Scale_(music)


Every Good Boy…

Crazy how these two disciplines are so intertwined.


> Every Good Boy…

  Do Re Mi Fa So La Ti Do, So Do ... compile please!
:-D

EDIT:

Seriously, though, what both music and fundamentally sound programming languages have in common is math. Elegantly defined versions of both are beautiful expressions of thought.


Yes, but the programming languages is much more well known.

Regardless, cool! This is the first project I'm aware of to have been written in Ada


Do you have any specific restrictions on what a 'project' means here? I have seen Ada used on an extensive scale in aerospace and defense projects, including a simple realtime OS.


Most of those projects are pretty locked down/closed, I just mean I can actually see the project to a reasonable degree.


Fair enough. And yes, it's such a shame that there aren't more public, especially FOSS, projects in Ada.


Been slowly learning Ada these last few weeks and I regret not having learnt it years ago...

This thing is great.




This should have been in the title :)


Maybe not as obvious for those without formal education in """database normalization""" but it's pretty trivial to convert from a tree structure to a flat table structure using foreign key relations. Recursive queries aren't even that difficult in SQLite, so self-referential data can be represented cleanly too, if not a bit more difficult to write. IME most applications "tree structures" aren't self-referential and are better formalized as distinct entities with one-to-one relationships (ie. a subtree gets a table).

There's always the lazy approach of storing JSON blobs in TEXT fields, but I personally shy away from that because you lose out on a huge part of the benefits of using a SQL DB in the first place, most importantly migrations and querying/indexing.


Until just now, I've been trying to figure out why people think that JSON is necessary in the database? Yes, lots of data is hierarchical, and you just normalize it into tables and move on. The fact that some people don't work this way, and would like to put this data as it stands into a JSON tree hadn't occurred to me.

What problem does normalization solve? You don't have to parse and run through a tree every time you're looking for data. You would, however, need to rebuild the tree through self joins or other references in other cases, I suppose. It depends how far you break down your data. I understand that we all see data structures a bit differently, however.


> There's always the lazy approach of storing JSON blobs in TEXT fields, but I personally shy away from that because you lose out on a huge part of the benefits of using a SQL DB in the first place, most importantly migrations and querying/indexing.

SQLite at least provides functions to make the “querying” part of that straightforward: https://sqlite.org/json1.html


What problem are you trying to solve with this approach? Unless your document is huge and you need the ability to read or update portions of it, it is better to just read and write JSON.


There's a laundry list of benefits that all add up, not like one specific killer feature. Some applications really do have very complex configuration needs, but it's sorta situation dependent on whether embedding a scripting language or a database is the right solution (for really simple cases I'm more likely to reach for TOML).

An incomplete list of benefits of using SQLite:

- Runtime config changes for free

- type safety

- strong migration support

- incorrect configurations can be unrepresentable (or at least enforced with check constraints)

- interactable from text-based interfaces and strong off-the-shelf GUI support


Type safety as a benefit of SQLite? For me type safety is a negative of SQLite. Being able to store a different type that what the column is declared to store is a bug (not a feature). I also find the lack of DATE and DATETIME/TIMESTAMP to be less than ideal.


We are talking about an application file format, so "type errors" are about who's right: the application (even better, multiple equally right implementation of a specification) or random hackers altering the file in incorrect ways.

Loose type checks, e.g. NOT NULL columns of "usually" text, are loose only compared to typical SQL table definitions; compared to the leap forward of using abstract tables and changing them with abstract SQL instead of using text or byte buffers and making arbitrary changes, enforcing data types on columns would be only a marginal improvement.


I pretty much always store date/times as Unix epoch integers. Also use STRICT tables and set the PRAGMA to enforce foreign key constraints.


Most frameworks can serialize and deserialize JSON from strongly typed classes. For example, Newtonsoft in .NET. The rest isn't worth the effort for most people. Your scenario may be unusual.


I've certainly had some unusual contents in the past where we had approximately 10,000 configurable properties on the system, but we didn't use SQLite for that. Regardless, you ignored 3 of the 4 (I'll ignore the last one, it applies to JSON too) other points I made. My use cases aren't that weird and I'm not saying reach for SQLite every time, it's one option out of many. Migrations and runtime configuration change alone justify it for me in many cases.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: