Live data from Hacker News

Some fun with π in Julia

julialang.org

51–60 of 69 posts

Re: Some fun with π in Julia

#51

Earlier quoted context omitted.

I would say there's something magical about the way that Julia is structured that makes it more than just a scientific language. I wrote a DSL for Julia for writing clean combinatorial verilog (haven't tackled sequential yet) in 3 days, using lispish macros. It took another 1 day to hook it up to 'verilator' which transpiles the verilog to C and lets you crosscheck it by loading it back up in Julia. https://github.co…

That's really nice. Now we need VHDL.jl as well - maybe different HDL backends could be bolted on? Julia is much better suited for this than Scala due to Julia's macro system.

Although I don't know that much about VHDL, it probably won't be that hard to either fork it or make it an option.

Drop a line. My contact info is in my profile.

Re: Some fun with π in Julia

#52
post #47
post #43

Earlier quoted context omitted.

When I last used it, the time to import even two modules was many seconds. I know that's JIT time, but that breaks the flow of developing with Julia like it's a dynamic language. And the JVM is popular, yes, but nobody would call it "extremely fast", particularly for interactive use, because of its startup time. The time to parse the data I needed was many minutes, slower than Python. Restarting a Jupyter kernel woul…

When was the last time you used it? Module loading times improved significantly with precompilation in 0.4.

Yeah, it was 0.3. So that would address the importing problem, if the modules I'm importing use the precompilation system.

How is string performance doing?

Re: Some fun with π in Julia

#53
post #30
post #6

I have always been skeptical about 'scientific' languages. Why do you need a special language when any general language + some libraries will do? This is a good example of a feature that only really makes sense in a scientific language.

I've done mathematical programming in both C++ and MATLAB. As much as I hate MATLAB as a language, it's way faster and easier to prototype things. There's a huge library of vetted functions for scientific things I'm interested in, and having matrices built into the language is great. MATLAB has tons of warts though, so I'm looking forward to switching to Julia this summer.

One of the biggest warts is the casual elision of vectors and nx1 matrices... (and scalars and 1-arrays and 1x1-matrices). Julia wrestled with this in its early days, but I think the way it does things now is quite nice.

Re: Some fun with π in Julia

#54

Most times a julialang.org blog post is posted to HN, I wonder whether the choice of content is well chosen to spread awareness of and interest in Julia. I write this as a huge Julia fan; I use Julia daily, and it is both my favorite language and the language I know best. So I already think Julia is great. But reading many Julia blogs, especially those from julialang.org, would make me think Julia is only useful for…

That is the area of expertise by the creators, but that puts it on the rest of us Julia fans to promote Julia as a general purpose language and talk about how we use it. I am not a scientist but I find Julia very useful for all sorts of practical stuff. E.g. people seldom talk about how great Julia is for writing shell scripts.

Re: Some fun with π in Julia

#55
post #52
post #47

Earlier quoted context omitted.

When was the last time you used it? Module loading times improved significantly with precompilation in 0.4.

Yeah, it was 0.3. So that would address the importing problem, if the modules I'm importing use the precompilation system. How is string performance doing?

A LOT has happened since then. For such a young language which hasn't even reached version 1.0 yet you can expect a lot of changes still.

You should seriously try out Julia again. I think it really works well now. I used to have a lot of issues with it before. Stuff would break, slow startup times etc. Today I don't really have any complaints.

Ok I got a few small ones. The limits on the ability to redefine stuff as you develop in the REPL can be a bit cumbersome.

Re: Some fun with π in Julia

#56
post #6

I have always been skeptical about 'scientific' languages. Why do you need a special language when any general language + some libraries will do? This is a good example of a feature that only really makes sense in a scientific language.

I'm not sure if "special language" is a particularly apt description of what Julia is. SQL is a "special" language.

At any rate - a lisp-like language with llvm backend, package manager, and a (small, but not trivial) group of users writing real software - what's not to like?

I (still) recommend the talk: "Julia - to lisp or not to lisp?", that gives a quick overview of some of the design choices:

https://youtu.be/dK3zRXhrFZY

For me, I like that it has a real story trying to balance "actual integer math" (not this silly machine constrained twos-compliment hack" and "you could conceivably write a ray tracer that wasn't unusably slow" :)

Re: Some fun with π in Julia

#57
post #30

Earlier quoted context omitted.

I've done mathematical programming in both C++ and MATLAB. As much as I hate MATLAB as a language, it's way faster and easier to prototype things. There's a huge library of vetted functions for scientific things I'm interested in, and having matrices built into the language is great. MATLAB has tons of warts though, so I'm looking forward to switching to Julia this summer.

One of the biggest warts is the casual elision of vectors and nx1 matrices... (and scalars and 1-arrays and 1x1-matrices). Julia wrestled with this in its early days, but I think the way it does things now is quite nice.

Let's not forget the complete lack of package management, where it guesses at which of the many overlapping functions you intended to call.

Re: Some fun with π in Julia

#58

Genuine question, As a professional developer, why would you restrict yourself to such technology? what we should be asking here is why? give me one scenario where this language is more appropriate than the plethora of other domain specific languages. would you bet your company on such language when there is more mature languages already ?

Genuine question, why do you assume it is a restriction? I am a professional developer and not a researcher or scientist which is the original target for Julia. Yet I find Julia to be my favorite language, and I've tried a lot of them. I can't think of any language which I find as expressive as Julia apart from Haskell, but that is exceedingly cumbersome to deal with given the strict type system. Haskell is beautiful but it is overly academic and requires a lot of investment in time and brainpower to work in your favor. Julia on the other hand is quite quick to learn and gets you productive quickly.

I'll mention multiple areas I think Julia excels. If you want to write quickly high performance numerical software then I don't see what the alternatives are.

It is the best language I've encountered for writing shell scripts. Bash is terrible due to the difficulty of factoring the code into functions and the frequency in which you forget to quote variables properly. Many end up thus using Python or Ruby. Ruby seems very popular, but Julia really works better. It has tighter integration with the shell and handles chaining, reading and writing to shell commands much nicer.

It also has all sorts of useful stuff ready to use out of the box and sane function names etc. I find it much more cumbersome to write shell scripts with python. Awkward to call processes. Got to always remember what every little module you got to import. Because of multiple dispatch, Julia allows much better naming of functions.

And as a computer language geek I love powerful LISP macros, but I can't get used to LISP syntax. Julia is the only language I know of which gives access to powerful macros and code generation similar to LISP.

Re: Some fun with π in Julia

#59
post #52
post #47

Earlier quoted context omitted.

When was the last time you used it? Module loading times improved significantly with precompilation in 0.4.

Yeah, it was 0.3. So that would address the importing problem, if the modules I'm importing use the precompilation system. How is string performance doing?

0.3 was quite some time ago – string performance was certainly a problem back then (an acknowledged one). String performance on 0.6-alpha, released last week, is very good. It should now be at least as good as scripting languages that have traditionally focused on strings (Python, Ruby, Perl). There are a few more tricks we could do in the future that could make this even faster, but they involve a fair amount of GC trickery, so we'll have to see.
Post reply on HN