Better HN
topnewbestaskshowjobs
Log inSign up

hellofunk

9,428 karma · joined Jul 10, 2015 (11y ago) · 3,276 submissions

John Bellick, Mexico City
Submissions

comment 9y ago · link · parent

Ada provides ranged types but is not a dependently typed language. So I guess it sort of falls into this particular example, but would not apply to other examples in this arena.

comment 9y ago · link · parent

I honestly thought this was a joke. The dancing model in the videos helps perpetuate this fallacy.

comment 9y ago · link · parent

Cool, but I don't know much about Ada, and would like to see an example for a statically-typed "range checker" in a more mainstream language used actively today. C++ templates can do a lot of magical stuff at compile time but such techniques are well beyond the reach of most developers.

I can't think of any typed language I've used or seen in active modern professional work where you could validate a value as part of a type at compile time.

comment 9y ago · link · parent

In my own subjective experience, I've found the idea to make a lot of sense and probably be true. I've done equal amounts of professional work in C++ and in Clojure, both languages I like a lot (and they are about as different as two languages can be). To accomplish a task in C++ takes probably 10x the code of Clojure. I would say that my bug-hunting time spent is maybe 5x in C++ vs. Clojure. This, despite that C++ is quite strictly statically-typed.

comment 9y ago · link · parent

Yes but there are no mainstream or production-ready dependently typed languages, so I didn't mention that. But I wouldn't be surprised if dependent typing really is going to be the distant future of programming languages. Perhaps not too distant.

I also wouldn't be surprised if Clojure tends to do surprising things in this area with taking Clojure.spec more to the compilation stage; some of the most interesting research into type systems has actually be done by lispers (i.e. Typed Racket, Core.Typed) and there is active interest in it among the Clojure community.

comment 9y ago · link · parent

You are talking about a function (at runtime), not a type, verifying the range. And you can do that in any language, regardless of its stance on typing.

comment 9y ago · link · parent

You can say that something is a floating point number (a type) but what if that something must be between zero and one? A type can't tell you that.

Typing has its place but the idea that it catches all bugs at compile time certainly isn't true; the cycle of running the app itself, running its tests, is just as important for statically-typed code as dynamically typed.

Languages that have a sophisticated contract system* (like Clojure's Clojure.spec library) have a bit of a leg up in my opinion. You can much more precisely explain and control and test for the specifics of all values flowing through your system well beyond merely what type they are.

-- * Clojure's devs don't refer to spec as a contract system because it is quite a bit more versatile than that, and some are actually using it for compile-time checks, compile-time generative testing, and other nifty things that aren't covered by a "contract" system.

comment 9y ago · link · parent

I recently saw an analysis of frequency of bugs per language according to a breakdown of Github repositories, using issues and branches as a way to quantify bug reports.

It was very interesting to see that Clojure projects were among the least buggy of all languages represented. The report looked at a variety of factors to explain "bugginess", including typing and LOC, among other things. The conclusion in Clojure's case was that the very low line count necessary to write Clojure programs was vastly more influential on bugginess than for languages that were statically typed.

And I suppose that's true: a language that requires you write very little code is going to produce programs that are easier to write (and thus maintain), regardless of whether it is statically or dynamically typed.

comment 9y ago · link · parent

Yeah? Well, Jimmy Crack Corn and I don't care.

1540.

Dealing with Complex Table Views in iOS and Keeping Your Sanity(medium.cobeisfresh.com ↗)

3 points · by hellofunk · 9y ago · discuss

comment 9y ago · link · parent

> I'm not sure when chat rooms became a business tool.

IRC has been around for decades and is often used for the same purposes that I now use Slack for with various open source communities. Before slack, it was IRC for many years.

comment 9y ago · link · parent

C++11 changed the language significantly and for the better, and each subsequent version has taken it further in the right direction. You can now use C++ as a high-level tool without much or any concern for manual memory management, and can do a lot of functional-style programming very easily and nicely. C++17 in particular adds features that bring the syntax closer to modern high-level languages almost to the degree that it feels like a scripting language at times. Stuff like automatic destructuring, variable definitions scoped for all branches of conditionals, etc. It's really one of my favorite languages, though this year I'm not getting to use it as much.

1543.

Marble Machine (music instrument using 2000 marbles)(youtube.com ↗)

3 points · by hellofunk · 9y ago · discuss

comment 9y ago · link · parent

Honestly I just fail to see the point. The Netherlands has a much different climate from Spain or Italy. The avocados from Florida are far inferior from those in California. Try growing oranges in Michigan. Regions vary, why is everyone whining about the ability for a northern nation to grow large amounts of food despite its circumstances?

comment 9y ago · link · parent

I have definitely noticed a big difference in flavor among the common different tomato varieties available at a typical Dutch grocery.

comment 9y ago · link · parent

Just buy any of the many other tomatoes available at a Dutch grocery other than the cheapest option.

comment 9y ago · link · parent

Yet if you look at the total value of the exports, the Netherlands is second in the world only after the U.S. For a tiny nation that is quite impressive.

comment 9y ago · link · parent

I agree, there are a lot of strange comments here. First of all, you can get all kinds of tomatoes in the Netherlands, but everyone is talking about the super budget tomato that is so cheap it's nearly free. Second, there's a lot more than tomatoes to enjoy in the Netherlands. They have great asparagus, excellent bakeries, high-quality and cheap milk and yogurt, reasonably-priced and delicious fish. Lots of other vegetables are no less tasty in Holland than I've experienced in the U.S. or Asia, such as potatoes, cabbage, onions, broccoli, carrots. That the Dutch have figured out how to fill a demand for cheap vegetables for those who want them is not a bad thing.

comment 9y ago · link · parent

I think GMO tomatoes have not been commercially grown anywhere in the world since the 1990's, at least not on any meaningful scale.

comment 9y ago · link · parent

Unless you use this excellent library:

https://actor-framework.org/

1551.

Google still a ‘wonderful’ company, says EU's top antitrust enforcer after fine(cnbc.com ↗)

1 points · by hellofunk · 9y ago · discuss

comment 9y ago · link · parent

> so instead of having a mutable set, we have a mutable variable that points to a new immutable version of the set

This is not at all how functional data structures work. You're assuming that the data structures are the same as non-functional data structures, but merely without the ability to mutate them. That is not correct. Proper functional data structures are implemented completely differently.

One obvious exception to this is the Swift language, which is not really a functional programming language, and it does not have functional data structures. It uses copy-on-write which is somewhat similar to what you describe, but is not how functional programming languages do it.

comment 9y ago · link · parent

The reason you disagree about implementation details is because you do not understand the implementations.

comment 9y ago · link · parent

That is not how functional data structures work. Check out Okasaki's book "Purely functional data structures" if you want to know what we are talking about here. There is not a whole copy of data being made. They use structural sharing and there is almost never a need for the implementation to make a data copy. You can have a piece of data that "changes" as it passes through the data flow, but in reality very tiny changes are actually happening behind the scenes, even if the perception to the programmer is that large changes are happening.

comment 9y ago · link · parent

You really should read up on the implementation of FP data structures in languages like Clojure or Haskell before making statements like this. You sound silly. Clojure's immutable data structures are thread-safe, fast, and quite different than your apparent idea of what these kinds of data structures actually are.

comment 9y ago · link · parent

You do not understand how immutable data structures work; you are thinking about them from the context of mutation when they are very much not based on that mode of change. They are entirely different ways to organize data, and the implementations are quite different from what you seem to think they are.

comment 9y ago · link · parent

This is not true at all. That's the whole point of functional data structures: they prevent copying for doing work on immutable data.

comment 9y ago · link · parent

Without immutable data structures, FP will be much much slower.

comment 9y ago · link · parent

But without immutable data structures, even in a language like C you end up with a very expensive copying for FP work.

comment 9y ago · link · parent

Do I understand correctly that one big difference between AR on Android vs iOS is that the next iPhone will have advanced 3d sensing abilities that are currently years away on Android phones?
1
515253
110