Live data from Hacker News

Julia 1.0

julialang.org

391–400 of 446 posts

Re: Julia 1.0

#391
post #382

Earlier quoted context omitted.

Just because it is our common convention in lay conversation doesn’t mean it isn’t “arbitrary”. These spoken language conventions developed before there was an established name for “zero” or even a concept that “nothing” could be a number per se. For similar reasons, we have no zero cards in our decks, no zero faces on a dice, no zero hour on our clocks, no zero year in our calendar, no zeroth floors in our buildings…

> no zero hour on our clocks There is. We call it 12 for some crazy reason (it goes 12 AM, 1 AM, 2 AM, ..., 11 AM, 12 PM, 1 PM, ...). > no zero year in our calendar Which is quite irritating really. New Year's Day 2000 wasn't the start of the 3rd millenium, because there was no year zero. > East Asian babies are born with age one year But not western babies.

The 12 on a clock is a compromise to match between a 1-indexing oral culture and natural 0-indexing use case (which came from the Sumerians who had a better number system).

I don’t know the history of reported ages of Western babies.

> quite irritating really

Yes that is my point.

Re: Julia 1.0

#392
post #297

Earlier quoted context omitted.

The problem is the default behaviour: in Ada you can use whatever you want, in Julia the default is 1-based which is quite controversial.

Picking whatever you want is one line of code, and similar to the line you'd need to allocate any array. And your choice propagates to the downstream operations. Instead of complaining in the abstract, check it out, you'll be impressed. https://julialang.org/blog/2017/04/offset-arrays

I already know about this but if you use someone else's code in a library for example in Julia the library will most likely only work with 1-indexed array, in Ada it will work with any base index.

Default matters!

Re: Julia 1.0

#393
post #379

Earlier quoted context omitted.

Just because it is our common convention in lay conversation doesn’t mean it isn’t “arbitrary”. These spoken language conventions developed before there was an established name for “zero” or even a concept that “nothing” could be a number per se. For similar reasons, we have no zero cards in our decks, no zero faces on a dice, no zero hour on our clocks, no zero year in our calendar, no zeroth floors in our buildings…

> no zeroth floors in our buildings In (North?) America. In Europe, there's a ground floor (zero), then first floor (1), etc. Basement is -1 (etc.). A European friend of mine arrived at college in the USA, and was assigned a room on the first floor of the dorm. She then asked the housing office whether there was a lift, because she had quite some heavy luggage, earning some rather amused looks :-)

Yes, it would be interesting to know the history.

Whoever designed the European convention for labeling building floors was numerically competent.

Too bad medieval European mathematicians and the designers of Fortran weren’t. ;-)

Re: Julia 1.0

#394
post #385

Earlier quoted context omitted.

Off-topic, but how do you type footnote-style number?

Open a julia editor or the julia repl, type `\^1 ` and copy and paste the unicode superscript ¹ into your post. Or whatever else your preferred method of getting unicode characters is ;).

I see I'm not the only one that uses the Julia REPL to get unicode characters!

Re: Julia 1.0

#395

Earlier quoted context omitted.

> The blog mentions that Julia is supposed to be a general purpose language, and not a language built specifically for scientific computing. Is that wrong? No. Julia is a general purpose language that has so far been mainly focused on scientific and mathematical programming. It's design is probably least friendly to the real-time programming domain (GC based) but it can apparently be used there as well: http://www.ju…

Fun fact, the GC really isn't an issue and instead the opposite issue was found. There had to be callbacks built to slow down the computations for the robotics simulations in order to get it to run at real-time because it was too fast. https://github.com/JuliaRobotics/RigidBodySim.jl/blob/34ac43... Notice that this function is purposefully sleeping the differential equation solver in order to slow it down to the exac…

That's a very amateurish way to solve this problem. Games typically have a main loop which will check the amount of time that has passed on every iteration of the loop.

You can see how much extra time is left for that frame at the targeted frame rate, then sleep for that amount of time.

Then you never have to slow down anything else, you can set a maximum amount of cycles per second and you can sleep once per cycle. The faster the CPU, the less power it should use.

Re: Julia 1.0

#396
post #392

Earlier quoted context omitted.

Picking whatever you want is one line of code, and similar to the line you'd need to allocate any array. And your choice propagates to the downstream operations. Instead of complaining in the abstract, check it out, you'll be impressed. https://julialang.org/blog/2017/04/offset-arrays

I already know about this but if you use someone else's code in a library for example in Julia the library will most likely only work with 1-indexed array, in Ada it will work with any base index. Default matters!

[deleted]

Re: Julia 1.0

#397

Earlier quoted context omitted.

For scientific computing, showing the package ecosystem is the most important thing. When you look at this thread, people are asking about dataframes and differential equations. Julia's site reflects this: yes there are things like Pandas, and for plotting, etc.

The blog mentions that Julia is supposed to be a general purpose language, and not a language built specifically for scientific computing. Is that wrong? The first impression does leave me thinking that using Julia for different programming domains like distributed internet-facing servers or web services is not something it was built for.

For a talk on "Low Level Systems Programming in High Level Julia" see the following video:

http://www.youtube.com/watch?v=AaQ7XuAR2yY&t=5m6s

Re: Julia 1.0

#398
post #392

Earlier quoted context omitted.

Picking whatever you want is one line of code, and similar to the line you'd need to allocate any array. And your choice propagates to the downstream operations. Instead of complaining in the abstract, check it out, you'll be impressed. https://julialang.org/blog/2017/04/offset-arrays

I already know about this but if you use someone else's code in a library for example in Julia the library will most likely only work with 1-indexed array, in Ada it will work with any base index. Default matters!

It's straightforward to write library code in Julia that handles any type of index. If it doesn't, it is probably old code from before the time before offset arrays. Take a look at Tim's linked blog post.

Re: Julia 1.0

#399
post #243
post #174

Earlier quoted context omitted.

> … and avoid the benchmark game. ?

Escalating benchmarks that add increasing optimizations to continuously one up one another. In the "logical conclusion" of this left unchecked, the Fibonacci benchmark for example (d)evolves into a lookup table. Which is missing the original point, hence the desire to just leave everything un-optimized.

Unfortunately the arbitrary "leave everything un-optimized" also misses the point because in practice we don't.

> (d)evolves into a lookup table

We can make the arbitrary decision not to accept that, and instead try to use our best judgement on what optimizations to accept.

"One can, with sufficient effort, essentially write C code in Haskell using various unsafe primitives. We would argue that this is not true to the spirit and goals of Haskell, and we have attempted in this paper to remain within the space of "reasonably idiomatic" Haskell. However, we have made abundant use of strictness annotations, explicit strictness, and unboxed vectors. We have, more controversially perhaps, used unsafe array subscripting in places. Are our choices reasonable?"

http://www.leafpetersen.com/leaf/publications/ifl2013/haskel...

Re: Julia 1.0

#400
post #379

Earlier quoted context omitted.

> no zeroth floors in our buildings In (North?) America. In Europe, there's a ground floor (zero), then first floor (1), etc. Basement is -1 (etc.). A European friend of mine arrived at college in the USA, and was assigned a room on the first floor of the dorm. She then asked the housing office whether there was a lift, because she had quite some heavy luggage, earning some rather amused looks :-)

Yes, it would be interesting to know the history. Whoever designed the European convention for labeling building floors was numerically competent. Too bad medieval European mathematicians and the designers of Fortran weren’t. ;-)

The base level doesn't need to have a floor, it's just ground. Once you add a floor you are on the first floor above ground. Really your condescending tone as if all the mathematicians that prefer to work with 1 indexing are just incompetent is grating.

I'm happy to be writing

``` for i in 1:n func!(a[i]) end ```

to iterate over an object of length n. Or split an array as a[1:m], b[m+1:n]. Slicing semantics which are far more prevalent in my code (and the code I read) than index arithmetic, are truly vastly simplified by 1 based indexing of Julia compared to the 0 based numpy conventions. We simply no longer code in the world that Dijkstra argued for, and I have not seen anybody give a clear argument that is actually rooted in maths and contemporary programming.

I genuinely thought that the Python convention was brilliant, and that 1-based indexing in Julia would suck. It turned out not to be the case.

Post reply on HN