LWN: Comments on "An introduction to the Julia language, part 1" https://lwn.net/Articles/763626/ This is a special feed containing comments posted to the individual LWN article titled "An introduction to the Julia language, part 1". en-us Tue, 09 Sep 2025 17:10:22 +0000 Tue, 09 Sep 2025 17:10:22 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net An introduction to the Julia language, part 1 https://lwn.net/Articles/766177/ https://lwn.net/Articles/766177/ Cyberax <div class="FormattedComment"> <font class="QuotedText">&gt; I don't ever recall seeing a mile 0 mile marker on the road. Mile 1, Mile 500, etc, yes. Mile 0?</font><br> Lots of cities in Russia have them. There's a famous one in Moscow: <a href="https://commons.wikimedia.org/wiki/File:0_Kilometer_Point_Moscow_Russia.jpg">https://commons.wikimedia.org/wiki/File:0_Kilometer_Point...</a><br> </div> Fri, 21 Sep 2018 19:04:43 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/766167/ https://lwn.net/Articles/766167/ jake <div class="FormattedComment"> Exit 0 on the Garden State Parkway ... Cape May, NJ ...<br> <p> other places as well ...<br> <p> jake<br> </div> Fri, 21 Sep 2018 18:40:39 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/766166/ https://lwn.net/Articles/766166/ pizza <div class="FormattedComment"> <font class="QuotedText">&gt; I don't ever recall seeing a mile 0 mile marker on the road. Mile 1, Mile 500, etc, yes. Mile 0?</font><br> <p> There's a particularly famous one in Key West, Florida. (At the start of US Highway 1)<br> <p> </div> Fri, 21 Sep 2018 18:35:51 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/766163/ https://lwn.net/Articles/766163/ ssmith32 <div class="FormattedComment"> I don't ever recall seeing a mile 0 mile marker on the road. Mile 1, Mile 500, etc, yes. Mile 0?<br> <p> (Or kilometer, or feet, depending on your activity &amp; country).<br> <p> I will grant that, when diving, you can have a depth of zero, but that's the only example I can think of .. <br> <p> I never climbed a zero foot rock wall. Or used a 0 foot rope when doing so.<br> <p> Please elaborate with examples...<br> </div> Fri, 21 Sep 2018 18:32:51 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/765625/ https://lwn.net/Articles/765625/ mcortese <div class="FormattedComment"> Can someone come up with an example where one needs A=B to be a link instead of a copy?<br> </div> Wed, 19 Sep 2018 19:16:19 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764605/ https://lwn.net/Articles/764605/ ghane <div class="FormattedComment"> To quote Donald Knuth: <a href="https://xkcd.com/163/">https://xkcd.com/163/</a><br> <p> </div> Wed, 12 Sep 2018 00:39:29 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764529/ https://lwn.net/Articles/764529/ VITTUIX-MAN <div class="FormattedComment"> I take you get his point though. When you do more mathy stuff, you get less offset by one errors with 1-indexing, whereas C-thinking people, what most computer people are, say likewise that of course 0-indexing is natural.<br> <p> Engineers dislike Matlab too, because we too start from 0 usually.<br> </div> Mon, 10 Sep 2018 22:19:47 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764349/ https://lwn.net/Articles/764349/ marcH <div class="FormattedComment"> <font class="QuotedText">&gt; the data overall supports the Julia team's contention that Julia has generally achieved parity with Fortran and C</font><br> <p> Is Julia ready for *faster* than C? <a href="https://queue.acm.org/detail.cfm?id=3212479">https://queue.acm.org/detail.cfm?id=3212479</a><br> <p> (Fortran already is in some cases)<br> </div> Fri, 07 Sep 2018 08:16:11 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764348/ https://lwn.net/Articles/764348/ marcH <div class="FormattedComment"> <font class="QuotedText">&gt; Merely restating your wrong assertions and adding some new ones doesn't make them any less wrong than they were.</font><br> <p> In any case your tone makes sure the points you're trying to make start with a significant disadvantage.<br> </div> Fri, 07 Sep 2018 08:13:08 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764320/ https://lwn.net/Articles/764320/ mgb <div class="FormattedComment"> And yet in the real world beyond FORTRAN we do measure sizes starting with 0 for empty and we do measure locations starting from 0 inches, 0 miles, and 0 degrees.<br> </div> Thu, 06 Sep 2018 16:32:25 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764316/ https://lwn.net/Articles/764316/ fgrosshans <div class="FormattedComment"> <font class="QuotedText">&gt; "Prehistoric" means "we know nothing about it save what can be deduced/ inferred from artefacts because there are no written records dating back to this time". If you knew how people had counted in prehistoric times, they thus wouldn't have been prehistoric.</font><br> <font class="QuotedText">&gt; That's a contradictio in adiecto.</font><br> <p> No, it is not a contradiction. Written record does NOT mean no data. For example, comparative linguistic, tells us about languages before they get attested in writing. If one looks, for example, at the best known language families (but it is also true for others), one can see related words for numbers (both cardinals and ordinals) starting at one, the words for zero appearing much later, in historical time. Form this data, it is difficult to conceive widespread prehistoric zero-indexed counting practice, which would simultaneously disappear across these wide-spread and non-communicating civilizations with the invention of writing.<br> <p> Another counter-example is proto-historic Mesopotamia, where we have written/material notation of numbers centuries before this number notations evolved into a full writing systems, which included a zero, but later and only in technical texts.<br> </div> Thu, 06 Sep 2018 15:55:17 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764270/ https://lwn.net/Articles/764270/ CycoJ <div class="FormattedComment"> Two things that seriously put me off julia last I tried, were:<br> <p> 1. They copied the most infuriating bits of matlab. The 1 vs 0 indexing is maybe a might annoyance, but the stupid use of the "." and " ' " to denote element-wise and transpose is horrible. My numeric programming is to the largest degree not linear algebra, so I mostly want element-wise operations. I can live with the fact that they defaulted to matrices instead of arrays by default (although I would argue they should actually call it properly), however using the '.' is just horrible. When I was still using matlab, I don't know how many hours I was debugging code where it ended up being "search the missing ." They are way too easy to overlook in regular editors but often don't cause your code to crash, but simply give non-sensible results (often not easy to deduce what went wrong). Similarly for the ' as the transpose operator, again a symbol that is way to easy to overlook, but will often not cause a crash but simple wrong results. I see the same errors with the students I supervise who are still using matlab (I know I am doing my best to convert them to use a proper language). This really is a significant development cost.<br> <p> 2. When I tried it a couple of years ago the recommendation for getting the best speed was to unwrap vector operations into loops. Hopefully they fixed that by now, because the reason whey I use a high-level programming language is because I don't want to do explicit loops for multiplying to arrays. <br> <p> <p> </div> Thu, 06 Sep 2018 12:25:02 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764261/ https://lwn.net/Articles/764261/ oldtomas <div class="FormattedComment"> <font class="QuotedText">&gt; The 1-based indexing has been used in mathematics for ages because [...]</font><br> <p> Translation: "My preference is The Way God Intended, so everyone should do it My Way". Not very convincing, is it?<br> <p> <font class="QuotedText">&gt; The 0-based indexing was only thought a clever idea because then you can avoid "wasting" a memory word,</font><br> <p> Bzzzt. Wrong. When I started my studies (physics, maths), 1975 (four years after C), most languages around indexed still from 1. Language implementors were no idiots (even back then, go figure!) and didn't leave "word zero" empty just to start counting from one.<br> <p> Our maths faculty counted from zero, physicists were half this, half that way.<br> <p> My observation since then is that math faculties tend to vary between counting from one or from zero; those strong in mathematical logic and model theory seem to prefer zero.<br> <p> My take is: I clearly prefer zero to be a natural number. But starting a holy war on this is the worst of all three choices.<br> <p> Come on: you can do better than that.<br> </div> Thu, 06 Sep 2018 10:16:35 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764249/ https://lwn.net/Articles/764249/ Wol <div class="FormattedComment"> <font class="QuotedText">&gt; Fortran has been considered practical long term, and there you can index arrays any way you want - even with negative indices</font><br> <p> And FORTRAN is 1-based and you can't change the index. They were prepared to change and break things when they went from FORTRAN to Fortran, yet this is something they extended rather than broke.<br> <p> (Don't feed a FORTRAN loop into a Fortran compiler and expect it to work! Incidentally this is 1 or 0 based - a FORTRAN loop is 1-based while a Fortran loop is 0-based :-)<br> <p> Cheers,<br> Wol<br> </div> Thu, 06 Sep 2018 06:52:13 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764248/ https://lwn.net/Articles/764248/ Wol <div class="FormattedComment"> <font class="QuotedText">&gt; Typically in languages with 0-based indexing the idiom will be to use a &lt; comparison for the upper bound</font><br> <p> Which is a trap for the unwary, or noob.<br> <p> All languages have idioms. I once wrote a piece of code - in a class for C beginners - that effectively did<br> <p> count = 0<br> for i = 1 to 13<br> count += (cardvalue == 3)<br> next<br> <p> to find out how many threes were in the hand. I just could not get the lecturer to write the addition line correctly on the board until I told him to write it down, character by character, as I spelt it out. To me, that idiom is second nature, to him it was totally alien.<br> <p> And yet, it SHOULD be completely natural to users of any language (like C) where the language defines the result "true" as being represented by the integer "1". (Note I said "result" not "value" ...)<br> <p> and you'll find plenty of C programmers to whom the "&lt;" idiom is alien, until they've been programming in C for quite a while and had it rammed in to them.<br> <p> Cheers,<br> Wol<br> </div> Thu, 06 Sep 2018 06:43:47 +0000 0 versus 1, the eternal battle https://lwn.net/Articles/764247/ https://lwn.net/Articles/764247/ Wol <div class="FormattedComment"> <font class="QuotedText">&gt; Don't mathematicians usually designate elements of arrays starting from 1, such as a₁, a₂, a₃, …, an? </font><br> <p> This is a LIST. Arrays are usually used to store lists. Lists don't exist in relational theory, and arrays are second class citizens in C. Hence relational/C guys don't understand why people should want to start at 1 :-)<br> <p> Cheers,<br> Wol<br> </div> Thu, 06 Sep 2018 06:33:37 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764244/ https://lwn.net/Articles/764244/ Wol <div class="FormattedComment"> <font class="QuotedText">&gt; In both the real world and the computer world we measure sizes using cardinals starting with 0 for empty.</font><br> <p> And how many ordinary people do you know in your "real world"?<br> <p> In my real world, most people aren't interested in maths. In my real world an object with size 0 usually doesn't exist. In my real world I would be tearing my hair out if I tried to explain why counting from 0 made sense.<br> <p> Yes, I count from 0 when programming in C. But my preferred language "sort of" starts counting from 1 - arrays have an element(0), but that's all arrays, including two- and three-dimensional arrays! And the language does fancy things with element 0, precisely because it doesn't make sense to have an element 0 in normal use - you don't have a zero-th element in a list. (Programmers - database guys especially - seem fixated on sets, which because they don't have order, lack the concept of counting FROM ONE.)<br> <p> And when I'm programming *for* the real world, an array location of 0 actually almost never makes sense. There's a reason C says an array and a pointer are equivalent - 0 makes sense for pointers, it does NOT make sense for arrays, and as someone who knows both C and FORTRAN as first-class languages, I always find it weird using arrays in C precisely because it is a pointer-based language, whereas the concept of pointers is totally alien to FORTRAN.<br> <p> As an assembly-level language C doesn't hide the fact that *internally* arrays start at 0. But it's a damn sight easier to use a higher level compiler (like FORTRAN) to hide that fact from the user, because if the user is not a professional programmer (ie most FORTRAN guys, and Julia's target audience) they have no need to know that.<br> <p> Cheers,<br> Wol<br> </div> Thu, 06 Sep 2018 06:31:08 +0000 0 versus 1, the eternal battle https://lwn.net/Articles/764241/ https://lwn.net/Articles/764241/ bjlucier <div class="FormattedComment"> You might look at the Scheme language SRFI 122<br> <p> <a href="https://srfi.schemers.org/srfi-122/">https://srfi.schemers.org/srfi-122/</a><br> <p> which contains my suggested way to work with arrays. Not quite a_penguin, but almost.<br> </div> Thu, 06 Sep 2018 05:25:36 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764235/ https://lwn.net/Articles/764235/ kvaml <div class="FormattedComment"> Mark and Luke were counting days between events in their narratives. They disagreed on how that count should be performed.<br> <p> Ancients lacked zero and lived before Descartes. Insisting that we should continue to count as they did is probably a mistake.<br> <p> </div> Thu, 06 Sep 2018 02:34:29 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764054/ https://lwn.net/Articles/764054/ togga <div class="FormattedComment"> "This is not something a scientific programmer will commonly do"<br> <p> Really?<br> <p> I guess this "scientific programmer" will not commonly integrate different components from different languages either. Nor does this "programmer" commonly need to map anything to a memory model (protocol, disk-layout, ...). This "scientific programmer" you describe seem very limited to me.<br> <p> Is Julia designed to be a programming language aimed for computers or for mathematicians that don't want to change old habits inherited from a time before computers existed?<br> <p> </div> Mon, 03 Sep 2018 18:58:44 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/764005/ https://lwn.net/Articles/764005/ leephillips <div class="FormattedComment"> Yes, if your calculation is such that you can take advantage of these libraries, you will get the performance of C or Fortran, with, for many routines, automatic parallelization. But, as I said in the article, "you can only take advantage of this if your calculation fits the pattern of an available routine". What Julia offers is fast performance not only for standard manipulations, such as matrix multiplication, but for calculations that do not fit one of these molds, for which you would need to write loops over arrays or other data structures.<br> <p> </div> Mon, 03 Sep 2018 15:31:25 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763996/ https://lwn.net/Articles/763996/ anselm <p> This is why many people in science these days use SciPy and NumPy, which essentially push many such calculations into C extensions and keep the Python code reasonably high-level and fast. </p> Mon, 03 Sep 2018 12:14:42 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763986/ https://lwn.net/Articles/763986/ billygout <div class="FormattedComment"> What's more confusing to me is that `global` was needed in the assignment statement in the loop, but not in the first line in the loop `print(i)`. Why would that be?<br> </div> Sun, 02 Sep 2018 21:20:26 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763971/ https://lwn.net/Articles/763971/ Cyberax <div class="FormattedComment"> The "two language problem" here is for a very particular case of scientific code.<br> <p> If you're using Python then you often have to use C/C++ to get enough performance because Python itself is too slow for naïve looped calculations.<br> </div> Sun, 02 Sep 2018 08:51:14 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763967/ https://lwn.net/Articles/763967/ droundy <div class="FormattedComment"> Yes, and as someone who teaches computational physics using python, this is probably the worst problem in terms of confusing students and introducing bugs that students are unable to track down. It seems a terrible idea to reproduce this bug in a language specifically intended for scientists with little training in programming.<br> </div> Sun, 02 Sep 2018 03:03:18 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763966/ https://lwn.net/Articles/763966/ droundy <div class="FormattedComment"> This seems like the major flaw in the idea that Julia solves the two language problem. If it's not a general purpose language then it's always going to be a second language for anyone with more than the most basic needs.<br> </div> Sun, 02 Sep 2018 02:59:24 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763963/ https://lwn.net/Articles/763963/ k8to <div class="FormattedComment"> Sure, though I agree with the contention that suggests many people give too little care for it across the breadth of coding scenarios. I know I've made the error, and I'm pretty anal retentive about thinking about edge cases and trying things out to validate correctness.<br> <p> <p> </div> Sat, 01 Sep 2018 22:47:08 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763961/ https://lwn.net/Articles/763961/ mpr22 The level of "caring about code quality" I would want to be applied to safety-critical software for operating a flight control system, radiotherapy machine, or nuclear reactor is much, much higher than I think is reasonable to apply to, say, a seven-day roguelike :) Sat, 01 Sep 2018 20:45:28 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763960/ https://lwn.net/Articles/763960/ cpitrat <div class="FormattedComment"> I've often heard the 'I don't write critical code, I don't need all your safety practices' or 'seriously, why would I need unit tests ?' from researchers, including some in computer science. One of them once published a paper and a few months later, another researcher contacted him telling he couldn't reproduce the result and whether he would share his code. It turns out he found multiple bugs that made his result invalid. It turns out you should care about your code quality even when you're not writing code for a nuclear reactor.<br> </div> Sat, 01 Sep 2018 19:35:54 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763948/ https://lwn.net/Articles/763948/ rschroev <div class="FormattedComment"> I see where you're coming from. Yes, modern languages in many cases don't require you to index at all, so I guess you could say that any indexing you do need is low level. That doesn't make Dijkstra's reasoning low level, I think, but I see your point. <br> <p> Thanks for clarifying.<br> </div> Sat, 01 Sep 2018 09:02:25 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763935/ https://lwn.net/Articles/763935/ danielpf <div class="FormattedComment"> <font class="QuotedText">&gt; Did you read EWD831, "Why numbering should start at zero" (<a href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx">http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx</a>...)? </font><br> <p> Yes I did long long ago. I have programmed scientific applications in many languages (Basic, Algol, Pascal, C, Fortran, PLI, APL, Lisp, Forth, for some of the oldest) over decades and did not find Dijkstra arguments compelling. In practice the most convenient indexing scheme depends on the problem. Sometimes one would like to index arrays starting with negative numbers, or using other sequences, like x,y,z. <br> For some other problems (say indexing the day of the month) starting with 1 is the most obvious.<br> Forcing scientists and other users to count with a single rigid scheme while the compiler can easily do the translation is, like programming in assembler, wasting neurones: it distracts from higher level considerations. <br> <p> Fortunately Julia, like Matlab or Fortran, allows to operate on arrays and other structures as global objects, or index them with complex conditions, so it is less and less necessary to care about the default indexing basis. <br> <p> For example a matrix product in Julia or Matlab takes one line:<br> julia&gt; X = A*B<br> <p> The equivalent C code requires several lines, 3 loops, 3 indexes, where the 0-based indexing must <br> be respected as well as the matrix dimensions, and of course is far less optimal for large matrices <br> than what is done internally by Julia. <br> <p> sum = 0;<br> for (i = 0; i &lt; m; i++) {<br> for (j = 0; j &lt; q; j++) {<br> for (k = 0; k &lt; p; k++) {<br> sum = sum + A[c][k]*B[k][d];<br> }<br> X[c][d] = sum;<br> sum = 0;<br> }<br> }<br> <p> So the way out of the 1- or 0-indexing discussion is to program at higher level than indices when possible, and to have the freedom to choose the starting index when not possible. <br> <p> <p> <p> <p> </div> Fri, 31 Aug 2018 22:56:30 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763930/ https://lwn.net/Articles/763930/ rschroev <div class="FormattedComment"> I'm not going to argue for or agains 0-based or 1-based indexing, I just want to point something out:<br> <p> <font class="QuotedText">&gt; And scientists are like normal people, they mostly don't care about the assembly language level elegance that Prof. Dijkstra was promoting.</font><br> <p> Did you read EWD831, "Why numbering should start at zero" (<a href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html">http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx...</a>)? Dijkstra's arguments are completely language-independent, and are rather abstract and high level. I don't understand where you get the notion that his reasoning has anything to do with assembly language level. And I certainly don't understand how/where Dijkstra was promoting assembly language level elegance. You're not confusing things with Donald Knuth's MIX and MMIX, I hope.<br> </div> Fri, 31 Aug 2018 20:52:51 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763928/ https://lwn.net/Articles/763928/ epa <div class="FormattedComment"> The idiom of "in your fortieth year" is also known in English (and even the 1-based year numbering is explained by the long form, the two thousand and eighteenth year of Our Lord). Also, of course, your first birthday is not really your first.<br> </div> Fri, 31 Aug 2018 20:35:50 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763927/ https://lwn.net/Articles/763927/ leephillips <div class="FormattedComment"> Thanks for that interesting comment. I wonder if it would be possible to create subscript indexing with macros. Have you looked into Donald Knuth's literate programming system? Your remarks suggest that it might interest you if you haven't.<br> <p> 'But now, as it [Python] has "matured", it makes the programmer specify more things that have nothing to do with the heart of the algorithm.'<br> <p> Can you give an example of what you mean?<br> </div> Fri, 31 Aug 2018 19:22:57 +0000 0 versus 1, the eternal battle https://lwn.net/Articles/763916/ https://lwn.net/Articles/763916/ mgb <div class="FormattedComment"> a₁, a₂, a₃, … is a sequence. Sequences often start with a₁ but this is not always the case. However a sequence is a function, not an array.<br> <p> If a sequence is finite you can represent or even define the function by an array of values but you'll usually want to work with with an expression defining the function.<br> <p> (x, y, z) is a kind of finite sequence but in a high-level language you're probably going to access the ordinates by name or implicitly iterate over them rather than accessing them as (a₁, a₂, a₃).<br> <p> </div> Fri, 31 Aug 2018 17:39:47 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763908/ https://lwn.net/Articles/763908/ hackerb9 <p>This was a timely and helpful article for me. <p>Every so often, the language I've been using becomes encrusted with extra requirements that make programming less joyful but safer for, say, a nuclear power reactor. Since I don't program nuclear power reactors, this has sometimes led to me shifting my coding preferences. <p>In the early days, Python started out looking very much like executable pseudocode, which I thought was fabulous. But now, as it has "matured", it makes the programmer specify more things that have nothing to do with the heart of the algorithm. Even C, which is pretty ugly nowadays with all the mandatory casts and declarations, was much more readable, almost beautiful, back when it was invented. <p>Maybe some day programming languages will have dynamically expandable footnotes and we can encapsulate all the ugly (but necessary) details in some hidden away spot that won't distract from the main point we're expressing. It's kind of ridiculous that most of programming today uses pretty much the same typography capabilities of Hollerith punchcards. <p>Until that day, Julia looks pretty awesome, at least in its 1.0 state. In terms of being able to powerfully express concepts in a natural way and with a minimum of mandatory cruft, it has Python beat. It's so far been as close to C in speed as I need and much faster than Octave and Numpy. I love that the REPL command line works the way I expect and already know: tab completion, LaTeX to express Unicode (<code>while ɛ&gt; ♥ &lt;3</code>), emacs editing key sequences, history, multiline editing, defaults to printing to console if no semicolon, and on and on. <p>And, can I just say, that I love having a language the properly treats Unicode as the default instead of ASCII. I can talk about ℵ₀ ∈ ⅄ or use a variable named ɛ when that's what I mean instead of spelling it out in English (<i>"epsilonButYouKnowThatBackwardsThreeVariant"</i>). Although, I do kind of wish Julia did not use Unicode for subscripts, as it is rather lacking. For example, you can't write <i>dB<sub>SPL</sub></i>. Also, to me subscripts are the most compact and readable way to specify the index into an array, as in: <i>a<sub>i</sub> = a<sub>i-1</sub> + a<sub>i-2</sub></i>. If they were going to support subscripts in a mathematical language it would have been nice to have it be as a syntactical alternative to using square brackets. <p>All in all, I think Julia is a strong contender to be my language of choice over the next decade, or until it becomes old and ossified. I did notice one little annoyance already. The print function cares whether there is a space before the open parenthesis. Apparently this is a new thing as it complains that I'm using "deprecated" syntax. I can live with it, but I hope it doesn't foreshadow Julia 2.0 becoming even more naggy and less natural. Fri, 31 Aug 2018 17:36:04 +0000 0 versus 1, the eternal battle https://lwn.net/Articles/763913/ https://lwn.net/Articles/763913/ danielpf <div class="FormattedComment"> A modern language like Julia allows to take an arbitrary sequence or set of any type, and loop over it. <br> Also any label can index the elements of a table. <br> <p> In pseudocode it reads like <br> <p> From Monday to Friday do ... end, <br> <p> From "a" to "r" do ... end <br> <br> Age[John]<br> <p> When operating over structures one can need either global operations such as <br> <p> A = sin(B) + 1<br> <p> where A and B are structures (could be arrays), or one needs to operate on a subset of the structures<br> determined by a condition (for example all the prime numbers in array A are set to 0: A(isprime) = 0).<br> In such frequent cases the way the elements are addressed is irrelevant. <br> <p> So the higher level people program the less relevant the indexing is. <br> <p> <p> <p> </div> Fri, 31 Aug 2018 16:58:34 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763911/ https://lwn.net/Articles/763911/ rsidd <div class="FormattedComment"> Ok, here's what many of you are missing. Arrays are discrete. Time is continuous -- eg hours, years, which can exist non-integrally. So is the FFT (ok, it's discrete but it's an approximation for a continuous thing.)<br> <p> Zero-indexing makes sense for "discretized" continuous or periodic things. It makes sense to label the first hour after midnight the zero hour: the markers are 0 and 1, at either end, and even for continuous periodic things, the "mod" argument makes some sense for zero-indexing. <br> <p> For sequences in general, nobody refers to "a" as the zeroth letter in the word "algorithm". It is the first letter. This is just how daily language works and also how mathematical notation works for the most part. The FFT may start from a zero-index but that's fundamentally because it's based on an assumption that the sequence is periodic. Vectors are always 1-indexed, except in relativity where time gets the index 0 while spatial indices are 1,2,3 -- and that too is for historic reasons (originally time was 4, but in imaginary units; when they figured it's better to use real units and a non-Euclidean metric, they chose 0 to avoid confusion.) <br> </div> Fri, 31 Aug 2018 16:08:43 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763910/ https://lwn.net/Articles/763910/ farnz <p>Or go further, as some places in Japan do. A bar can be open (say) 1800 to 2700, meaning in 12 hour terms "from 6pm today until 3am tomorrow"; similarly, a long distance transit route might have the last vehicle today leaving at 2330 and arriving at 2530 (meaning 0130 tomorrow), while the next vehicle leaves at 0015 and arrives at 0215. <p>Basically, today started at 0000 - time then runs continuously so that 2530 today is the same as 0130 tomorrow, and 4930 today is the same as 0130 in two days time. Fri, 31 Aug 2018 15:59:27 +0000 An introduction to the Julia language, part 1 https://lwn.net/Articles/763907/ https://lwn.net/Articles/763907/ hackerb9 Or do it like I've been told the U.S. Army does: 0..24. 0 and 24 refer to the same hour, but they use them to make the rest of the context consistent: for example, <i>We are meeting in the War Room from 23:00 to 24:00 and then having an ice cream social from 0:00 to 1:00</i>. Fri, 31 Aug 2018 15:26:20 +0000