Better HN
topnewbestaskshowjobs
Log inSign up

brokencode

3,309 karma · joined Mar 26, 2015 (11y ago) · 825 submissions

Submissions

comment 6y ago · link · parent

Check out Crystal’s official website sometime to learn more about its modern features. Crystal doesn’t have immutability, but does have support for functional programming and union types. “Compile-time guarantees” is such a vaguely specified feature that virtually all programming languages have that, but its type system is actually pretty strong despite how it looks with all the type inference, and even prevents null pointer exceptions unlike a lot of static languages.

It also has a lightweight threading system that makes it work well as a web server. Not quite as elegant as something like Elixir, with its isolated processes, but still nice. It also supports macros, which can make the code a lot more elegant and performant compared to similar languages.

comment 6y ago · link · parent

Because you are the beneficiary of hundreds of years of policies and systemic racism that has benefited you at the cost of your fellow man.

Imagine your parents stole a fortune from your neighbor and passed it on to you when they died. Does that money belong to you, or your neighbor/their children? I think the answer is common sense. The fact that you weren’t the one who originally stole the money is irrelevant.

comment 6y ago · link · parent

That’s a pretty indifferent attitude to take. Do things because you want to? A lot of people make these videos for a living, and have no choice but to feed the advertisement machine. The business model of the internet is not something most content creators have any control over, and it’s pointless to criticize them for it. The only players who might be able to do that are the big tech companies controlling the platforms, which is why they take a lot of flak for how things are going.

comment 6y ago · link · parent

The premise that we are on the verge of some breakthroughs in software development that will significantly reduce the need for engineers is really weak, and is something people have been saying for decades (see the failed fifth generation of programming languages from the 1980s for an example).

In my experience, software engineering is endless, complicated decision making about how something should work and how to make changes without breaking something else rather than the nuts and bolts of programming. It’s all about figuring out what users want and how to give it to them in a way that is feasible.

The idea that we will have some abstraction that will someday (in the foreseeable future) save us from all of this difficult work sounds very far fetched to me, and I can’t imagine how that would work.

Even the example of hosting complexity being replaced by cloud companies seems kind of silly to me. Maybe that’s saving very small companies a sizable fraction of their engineering resources, but I really doubt it for medium or larger companies.

The cloud saves us from some complexity, but it doesn’t just magically design and run a backend for your application. You still need people who understand things like docker, kubernetes, endless different database options, sharding, indexing, failover, backup, message queues, etc. Even if the pieces are now more integrated and easier to put together, the task of figuring out how the pieces will interact and what pieces you even need is still outrageously complicated.

comment 6y ago · link · parent

If you really believe that a company can churn out nothing but perfect products over and over again without making any mistakes, then maybe you have been drinking too much of Apple’s Kool-Aid. Every top company has good and bad generations of products, and Apple is no different.

This type of post complaining about Apple losing its soul and dying has been coming out regularly for at least the decade since I’ve been following Apple, and probably back way farther than that.

Something about Apple makes it an irresistible target for this kind of criticism for some reason. Check out the MacRumors forums for examples.. it’s a group of people who track every move Apple makes, yet overwhelmingly complain about every potential flaw.

That’s not saying that there aren’t flaws to criticize about Apple’s products, which there certainly are. But the level of vitriol is extreme compared to what I see directed towards most other companies (except video game companies.. gamers are a tough crowd).

comment 6y ago · link · parent

That’s all true, but I think a Typescript-like system would work really well here. Typescript is very tolerant of the data being different than the type definition, and it doesn’t know or care if your data actually matches the type definition at runtime.

It would be up to the developer to account for different versions of the data when writing out type definitions, and the worst case is that you try to access a property that doesn’t exist or is the wrong type, and it crashes and causes the process to get restarted like what already happens in Erlang.

So it wouldn’t be a guarantee of correctness just like Typescript isn’t, but it could still offer a lot of safety assuming you get the type definition a right.

comment 6y ago · link · parent

I’m not sure what you mean. A singleton is something your program only has one of. You can have any number of processes. By your logic, every object in an object-oriented language is also a singleton.

comment 6y ago · link · parent

If you look closely enough at Haskell, you’ll realize that it also can have a lot of mutable state. Haskell just puts state into various monads and STM to make its functions pure. You can even spawn numerous isolated threads, all with their own state, and have them communicate with one another like you do in Elixir. It does provide a lot of structure and guarantees compared to your standard imperative language, but I assure you mutable state is still there.

To be clear, the Elm model of putting everything into a big tree and and transforming that at every user input is very unusual among even FP languages, and is not the model typically used in Haskell. This might be what you are thinking of.

Edit: I also want to point out that Elixir processes can be registered globally to act as singletons, but by default you can spawn any number of agents or other processes at runtime, meaning they are not singletons.

comment 6y ago · link · parent

I think the content Fox News produces is so much lower quality than other sources that there just isn’t any reason to post a story from them.

comment 6y ago · link · parent

I think it’s kind of crazy that we have 64 core processors available, but still need so many servers to handle only a hundred thousand users. That’s what, a few thousand requests per second max?

Having many servers gives you redundancy and horizontal scalability, but also comes at a high complexity and maintenance cost. Also, with many machines communicating over the network, latency and reliability can become much harder to manage.

Most smaller companies can probably get away with having a single powerful server with one extra server for failover, and probably two more for the database with failover as well. I think this would also result in better performance and reliability as well. I’m curious to know whether the author tried vertical scaling first or went straight to horizontal scaling.

comment 7y ago · link · parent

I don’t think anybody is going to read a book just because you threw out a link. If you want to get your point across, you should condense what you thought was interesting about the book and make a case for why somebody would read it.

comment 7y ago · link · parent

I don’t see how this is a great example of how functional programming sucks. It is easy in any programming language to build a slow sorting algorithm. The fact that you need to use different algorithms with immutable data is irrelevant. You need to use different algorithms for pretty much any type of data structure.

Functional programming makes a different set of tradeoffs than imperative programming. You have to work harder to get peak performance, but in many cases it is actually quite performant. Just look at how fast Elm is for web applications, and how that approach allows for a time-traveling debugger and virtually no crashes.

comment 7y ago · link · parent

To them, I would suggest that they remember back to when they learned their first imperative language like Java or C. For me, that was really difficult to wrap my mind around at the time, but now those languages are second nature to me. I kind of suspect that if everyone were exposed to a functional language first, there would be a lot fewer people who think they are extremely hard to learn.

comment 7y ago · link · parent

Are you speaking from experience? The article is about the author’s experience from a year of using Haskell.

I don’t think it’s fair or constructive to disagree with his findings unless you also have experience using the language, and it doesn’t sound like that is the case.

comment 7y ago · link · parent

The author complains about Pocket, but I actually really like it. The quality of articles is good, and it isn’t just full of clickbait like a lot of other news feeds.

The browser does use your browsing history to decide which articles to show you, but they claim that information does not leave your device. The browser downloads the full list of articles onto your device and filters them there.

comment 7y ago · link · parent

I don’t really see the point in some fancy archival medium when so much data now is already stored in cloud-based servers with redundancy and constant hardware maintenance on a global scale.

I think there would have to be an apocalyptic event to cause knowledge about significant events, people, and ideas to be lost.

Paper and archeological history is absolutely riddled with holes, which doesn’t speak well of its durability.

comment 8y ago · link · parent

It’s fun to use that quote, but is it actually true? At one time, Perl was extremely popular, and was basically the Python of its era. Now, I barely ever hear about it, and it mainly seems to be used as a cautionary example of what can happen to a language when it goes through a major update.

comment 8y ago · link · parent

I agree that community management and handling of issues could be better in Elm, but I’m willing to overlook that due to the terrific quality and innovation of the end result. Elm has benefited greatly from vision and the willingness to take risks, which is much easier to do with less communication overhead and fewer contributors.

Maybe someday Elm will adopt a more community-oriented approach, but I don’t think that is necessary right now.

comment 8y ago · link · parent

Sure, those ideas might hold up for objects far away from the eyes, but for nearby objects there can a pretty big difference between what each eye sees. I think the human brain would quickly call BS on an image processed through that kind of compression, and it would not be very immersive or realistic.

comment 8y ago · link · parent

It’s not enough to have good “theoretical” performance when other languages already have measurably good performance today. I’m not trying to say that Nim is bad or slow, but when there are a dozen similar static, compiled languages to choose from, it’s easy to dismiss one based purely on the benchmarks alone. I understand that it’s sort of an optimization game with these benchmarks, but it’s at least a form of marketing, which is something that Nim can benefit from.

comment 8y ago · link · parent

Personally, the first thing I look at when I look into a new server side language is how it does in benchmarks conpared to other similar languages (such as the TechEmpower benchmarks). I know that those types of benchmarks are flawed in a lot of ways, but performance is probably the only objective way to evaluate a language, and I’m much more likely to learn about a language if it looks like it’s fast.

From what I’ve seen for Jester/Nim, it’s not really benchmarked a lot, and it doesn’t seem particularly fast where it is benchmarked. This could perhaps be fixed by better implementations for the benchmarks or some optimization in Jester itself.

I think a strong story for performance would go a long way towards improving awareness of Nim. Crystal does very well in such tests, and I think that is one of the most appealing parts of the language. In fact, I evaluated both Nim and Crystal for server side development a while back, and quickly dismissed Nim because it didn’t seem to be all that fast. I eventually dismissed Crystal too because of the compile times and syntax, but I put a lot more time into it.

comment 8y ago · link · parent

Everybody makes mistakes, no matter how confident they are in C. And while there are numerous things written in C, there is also a continuous stream of bugs and vulnerabilities as well.

That’s not to say that other languages are perfect, but there are much safer options that are still very fast, such as Rust, or even C# or Java.

comment 8y ago · link · parent

I agree completely that Apple’s cloud services aren’t very compelling right now. I’m just worried that they are trying to use IBM’s cloud instead of building out their own capabilities.

If they are going to improve integration with third party services, I would love to have better integration with Google’s services, not IBM’s..

comment 8y ago · link · parent

This makes me worried for Apple. IBM is not a company that comes to mind when I think of cutting edge cloud services, and Watson in particular has seemed to be a pretty mediocre product with heavy marketing and gimmicks (Jeopardy and H&R Block come to mind).

Does Apple really think that it would be better to outsource cloud services to IBM than develop their own? To me, it looks like Apple lacks confidence in their own internal abilities, and that’s not a good look.

comment 8y ago · link · parent

Surely an insurance company would prefer that the patient go elsewhere rather than have to pay $100,000+ every year on treatment. Even if they lose a customer, at least they don’t have that enormous expense.

comment 9y ago · link · parent

How do you envision media companies making money if people don't have to pay for their product once it's produced?

It's not like most people are going to pay Disney ahead of time for the next Pirates of the Caribbean movie, even though a lot of people will (inexplicably) pay to see it in theaters.

comment 9y ago · link · parent

The conventional wisdom applies to large, complicated software. The source for React comes in at around 109kb now. That couldn't be more than 10-20 thousand lines of code, which is quite small.

comment 9y ago · link · parent

Maybe because it takes most people hundreds or thousands of hours to learn a natural language, but the average programmer can get a basic understanding of a new programming language over a weekend? Plus, there's arguably no advantage of one natural language over another, whereas different programming languages can make very different tradeoffs.

comment 9y ago · link · parent

I think ramifications would be very serious for Google, since they rely on public trust and good will. There is little barrier to switching search engines and many alternatives.

comment 9y ago · link · parent

Not really. They are both valid comparisons, since ARC is much easier to work with than manual management and can offer more predictable performance than GC. That said, it's also slower than manual management and can be trickier to work with than GC.
1
2425262728