|
|
Subscribe / Log in / New account

An introduction to the Julia language, part 1

An introduction to the Julia language, part 1

Posted Aug 31, 2018 17:36 UTC (Fri) by hackerb9 (guest, #21928)
Parent article: An introduction to the Julia language, part 1

This was a timely and helpful article for me.

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.

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.

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.

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 (while ɛ> ♥ <3), emacs editing key sequences, history, multiline editing, defaults to printing to console if no semicolon, and on and on.

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 ("epsilonButYouKnowThatBackwardsThreeVariant"). Although, I do kind of wish Julia did not use Unicode for subscripts, as it is rather lacking. For example, you can't write dBSPL. Also, to me subscripts are the most compact and readable way to specify the index into an array, as in: ai = ai-1 + ai-2. 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.

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.


to post comments

An introduction to the Julia language, part 1

Posted Aug 31, 2018 19:22 UTC (Fri) by leephillips (subscriber, #100450) [Link]

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.

'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.'

Can you give an example of what you mean?

An introduction to the Julia language, part 1

Posted Sep 1, 2018 19:35 UTC (Sat) by cpitrat (subscriber, #116459) [Link] (2 responses)

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.

An introduction to the Julia language, part 1

Posted Sep 1, 2018 20:45 UTC (Sat) by mpr22 (subscriber, #60784) [Link] (1 responses)

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 :)

An introduction to the Julia language, part 1

Posted Sep 1, 2018 22:47 UTC (Sat) by k8to (guest, #15413) [Link]

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.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds