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

I have some doubts about this one, despite my love and ongoing professional work with Clojure. For overall productivity, I find the issue of typos more significant than this slide leads us to believe, especially in a language like Clojure where the compiler does not catch nearly 90% of my typos. It's very easy to have a nil running through your program in Clojure because you either mistyped a keyword or you just picked the wrong one when pulling something out of a map, for example. But that is just one example, I find that I spend a fair amount of my work day tracking down silly typos at run time, which frankly disappoints me tremendously. I really like Clojure but tackling this problem has been non-trivial.

comment 9y ago · link · parent

Amsterdam's bike-friendliness is at best average compared to the rest of the Netherlands :)

comment 9y ago · link · parent

I use the Clear app on iOS. Simple, means I will use it a lot, and I do.

If I need to voice memo, then I just use the stock voice memos app.

comment 9y ago · link · parent

I saw an issue or thread somewhere about the technical problems of supporting Closure Advanced in Bucklescript. I'm surprised they were solved at one point then regressed. What would be the reason for removing it, unless maybe it was easier to implement new features by no longer supporting it?

Closure Advanced has many benefits so it's really nice to support it, especially if you're writing a whole site app of decent size all in one codebase.

comment 9y ago · link · parent

I thought that Reason implicitly used Immutable-Re and Bucklescript implicity used Immutable, similar to how Clojurescript implicitly uses its own library from these structures. That is, if you write wholly within the language, you get the benefits of these structures without thinking about it. Is that not true?

comment 9y ago · link · parent

Is Elm using a particular library for its persistent structures, or are they custom for Elm?

I've read that it has both List and Array, yet neither appears to be ideal for proper functional programming; List, as you say, is a linked list, yet it is recommended [0] over Array for functional operations like map, fold, etc -- but you wouldn't normally want linked lists for that sort of thing, esp. if your maps and folds were part of a larger data transformation of composed functions. Does Elm offer anything similar to the structure of ClojureScript's persistent vector?

I have learned that FP without the guts of serious persistent structures is not so good in practice.

[0] https://stackoverflow.com/questions/37707577/array-vs-list-i...

comment 9y ago · link · parent

The two issues I have with Reason for me are:

1) It is not compatible with advanced optimizations in Google Closure's compilation process.

2) I've been burned by less than ideal implementations of immutable data structures for functional programming in the past, particularly in Elm. I haven't done enough with Immutable-Re to know if it has similar issues, but all functional data structures are not created the same. I'm spoiled by ClojureScript's implementation which has never thrown a stack overflow error for me, unlike Elm. In Elm, if you have a list that gets too large, you have to manually break it up into different lists and do weird concatenation stuff that is quite clunky because somehow it's not doing structural sharing quite right to ensure these things are transparent under the hood. Experienced Elm users helped explain this to me, and it's not something I like to think about when writing in a functional style.

So I've been a bit hesitant to embrace just any functional programming language for serious enterprise work. But I'm very intrigued by Reason and Bucklescript and am keeping a very close eye on them. I probably won't do more than toy projects in them any time soon, but it would be great to someday.

comment 9y ago · link · parent

You are completely correct. This is exactly what I've noticed among people when I lived there. A lot of it is subconscious. Singapore really has this strange and pessimistic psychological effect on its citizens.

comment 9y ago · link · parent

OOP used to mean something quite different than it does today. Learn smalltalk, you will be surprised.

comment 9y ago · link · parent

I don't think you've been following the developments in this area. The Netherlands is aiming for half of all car sales by 2025 to be electric. Norway is already at one-third all electric.

http://www.dutchnews.nl/news/archives/2017/06/electric-car-s...

comment 9y ago · link · parent

Taiwan is lovely but still suffers from air pollution. Much of it is local pollution, but some also that drifts over from China. I found it quite challenging when I was there.

But the food is great, so there's that.

comment 9y ago · link · parent

> This is the Singapore playbook

Interesting. When I toured several companies in Singapore, including Google, most of the staff were from Europe or the States. If Singaporeans are indeed doing well in their own schools, my guess is many are still leaving to work elsewhere. I frequently attended programming meetups where about 90% of the attendees were non-Singaporean.

But then, most of the Singaporeans I've known were quite happy to live and work in a Western country; I lived there briefly and was frequently asked by locals, "why would you want to live here, it's so small."

Regarding pollution, it was actually Singapore's air pollution that caused me to leave. I think I'm not alone with that sentiment.

comment 9y ago · link · parent

Except that Face ID does not work on photos at all. It's a 3d technology and requires the phone's 3d sensors (more than one) for recognising the face.

comment 9y ago · link · parent

Personally I just use the Goodreader app for music, and put my tracks on there and listen that way. Since my collection as a whole is in Dropbox, I can just pull whatever I want down into Goodreader when I want to keep it around on the device for awhile.

I too hate the iOS music app and any other app that attempts to improve the GUI nature of finding and exploring a music collection. I just want my tracks listed and easily jump between them. This app in this thread would seem to increase the amount of time I'd need to find a track; I don't care about all the fancy visuals, I just want to listen to music.

comment 9y ago · link · parent

I'm not sure what your evidence is for this, but I find C++ to be used far more widely than C in nearly all the companies I interact with that do critical low level work. And there is indeed plenty of information in the industry about flight control software in particular in C++. It's also very popular for embedded work, because C++ allows you to offload quite a bit of work to compile time that can only be done in C at runtime. And I've attended talks for security systems in C++ specifically because of control over exceptions and how to track unexpected events, which is something security professionals are very interested in.

With regards to tooling, the windows visual studio experience for C++ is widely counted as one of the best development setups in the industry for any language. I know lots of people working in other languages that envy what C++ developers get.

comment 9y ago · link · parent

I used to share your sentiment but kept going with vim for a year, and now I'm spoiled. Any time for some reason I am forced to use a GUI and a mouse, everything just feels so slow to me now.

comment 9y ago · link · parent

I can appreciate your desire to share the good news about Clojure adoption, but I don't think the language is in need of defense. It's used a lot all over the place, and you shouldn't feel the need to convince others of that. Because even if it weren't used hardly anywhere, it would still be a great tool for those of us who do use it. That it is in fact in use in a lot of places, regardless of its specific role, is just a nice added bonus.

If someone doesn't want to use it for this reason or that, it's their loss not ours. Those who need to find Clojure eventually will, because there is nothing else like it.

comment 9y ago · link · parent

Critical software is rarely written in anything except languages with explicit memory control, usually C++, and usually with very strict guides. There is a famous programming guide for flight control systems in particular that discusses how to properly use C++ for maximum safety during flight. It includes things like never allocating memory after take-off.

You wouldn't want Clojure, Java or any languauge with GC running in a pacemaker either. Those are all also very important distinctions.

comment 9y ago · link · parent

A lovely place in Western Europe.

comment 9y ago · link · parent

> and < are for numbers, so yes x and y are nums.

If you instead want to compare or sort other values, Clojure offers other functions for that purpose where you can specify in great detail how things should be compared. If > could operate on strings, for example, what would be the expected result? The shorter the string, the "lesser" the value, or the string that starts with the "lower" letter, etc... it's quite ambiguous. You need more than < or > for that kind of comparison.

comment 9y ago · link · parent

If you can agree that (> a b) makes easy sense, that a is greater than b (it's the same symbol as a > b, just in a different place), then I don't see how that's any more difficult than (> a b c), which means that b is also greater than c. But then I've been staring at lisp code for years.

comment 9y ago · link · parent

No, I'm not talking about static checking. I'm talking about property-based tests that run at compile time. Dependent typing is a different matter. What I describe is not dependent typing, but is quite straightforward now thanks to Clojure.spec. And there are a lot of community efforts in the research sphere to see where Spec can take static analysis, it's quite interesting.

comment 9y ago · link · parent

A country's size cannot be overstated. I don't know about cost, but for mere agility, the smaller a country is, the more nimble it can be for all sorts of reform and progressive progress. Singapore and the Netherlands are both small countries that have managed to overhaul aspects of society without much barrier in years past. Germany is a big place, the U.S. much bigger. Estonia, tiny. You can do all sorts of things when you have just a few people it will affect.

comment 9y ago · link · parent

I don't spend much time on the JVM, but in ClojureScript, this is what I get for a similar test (including multiple definitions of foo in my case, i've elided the whole source file here):

     (defn foo [a b] :hi)
     (defn bar [] (foo 1 2 3))

     WARNING: Wrong number of args (3) passed to prepost.core/foo at line 25 src/cljs/prepost/core.cljs
     WARNING: foo at line 24 is being replaced at line 48 src/cljs/prepost/core.cljs
It's a compile-time warning even when the app is not running, but ClojureScript goes through a different compilation step than JVM Clojure. Perhaps I was mistaken in the JVM case, or someone else can chime in.

comment 9y ago · link · parent

I agree with you that it's not necessary or meaningful to "name drop" companies that use some X technology as an indication of its worth. Languages and tools don't need a massive following by enterprise to be incredible and revolutionary. It's like a really good movie that didn't have a large audience but was nonetheless really awesome for those who did see it. That's a lot like how I think Clojure is.

comment 9y ago · link · parent

I would say nearly all my loops are either map or reduce. That's it.

comment 9y ago · link · parent

Indeed, on anything serious I write it at least twice. Of course, using Clojure makes this easy since there is usually not a lot of code to rewrite. But after you get into something, you know details about what is needed that you simply cannot adequately predict beforehand in a lot of circumstances.

comment 9y ago · link · parent

You can see my other comment to your same question. Also, even if you do not use Spec, you do get a lot of compile-time validation like making sure all arguments are passed to a function, not leaving them out, etc. Try that in Javascript!

comment 9y ago · link · parent

It can actually be used in a variety of ways. It can be a runtime assertion. It can also be used to automatically generated unlimited tests (using property-based testing, similarly to Haskell and other languages) and that can be done at compile time. That is, you write a spec for a function and the tests are automatically created to ensure that all valid input the function can handle matches corresponding output it emits.

Because these are not actual static types, you can get a lot of control and say things like "this function accepts three arguments, all integers between 5 and 50, but in increasing order, and the output must be a float between 0 and 1", and then have that checked on the function before the program ever runs. At run time, you can then verify that you are passing in valid arguments.

Spec is relatively new, and there are experiments in the community to do things more like traditional static type checking also. The future is an interesting place.

comment 9y ago · link · parent

foo is greater than bar is greater than boo

or, put another way, the arguments must be in descending order

It's like instead of writing 1 + 2 + 3 + 4 in Clojure, you write:

    (+ 1 2 3 4)
Less characters to type. Because operators are functions, which are always first in a list, normal binary operators like + can take many arguments.

Another benefit of this is function application. If you have a vector/array of numbers and you want to add them all up, just apply them as arguments to +:

    (apply + [1 2 3 4 5 6 ...])
If you had an array some-array that had hundreds of numbers, this would be trivial without doing anything other than using the same basic + function:

   (apply + some-array)
And since you are expressing the arguments as a single piece of data here, and you can have functions that are much more interesting than +, you can see where this leads.... building up arguments as data, using them in function application. It gets very interesting very fast and the language unlocks a lot of ideas you just don't get in other languages.
1
404142
110