Idea Julia Lite or 'Juliette'?

Hi. As I have taken on the learning of Julia as a project, I have increasingly wondered whether many of the ‘computer science niceties’ like immutability, strictness of variable types, broadcasting, etc, which undoubtedly allow great generality and elegance in programming (as well as efficiency) might be merely annoyance to a large proportion of users (like me) who are moving over from matlab/numpy/R, as well as for raw beginners. Far from complaining about Julia, which I regard as a wonderful project and resource, I wondered if there might be room for a Lite (‘human’?) version (maybe called ‘Juliette’?) which would use Julia as an engine, but which would go a bit further in user-friendliness, even tried to go a bit further still (admittedly at the expense of efficiency, elegance etc.) in attempting to figure out what the user wanted, or (in the case of serious ambiguity or erroneous commands) suggesting guesses to help with syntax?

Or is this just me being greedy and ungrateful?

I also come from Matlab, and to be honest, I don’t think that Julia should go the route of becoming similar to Matlab. Coding paradigms are different depending on the language chosen, be it Python, C/C++, Matlab or Julia - if one wants to learn one has to spend some time at the basic level of the language.

If one would do the split you propose, the community would be split, and the ones using “Juliette”, would over time, when getting better, realize that the performance is not so good and probably just drop it anyways.

Instead, I think a better solution is to increase the amount of tutorials and documentation, so that people can learn how to write code, how to debug and optimize this code. This would imo be better in the long run for the community.

Kind regards

20 Likes

I think those are difficulties of learning a new language. If you want to contribute to beginner-friendliness, you can write down those annoyances and problems, because more experienced users often do not know about them.

6 Likes

You can just stick to a subset of Julia if you prefer: use mutable structs, don’t declare type parameters, use Arrays of Any, and write loops. It is not recommended, but possible.

That said, I am very surprised to hear someone complaining about broadcasting as a user-level feature (I am not talking about hooking into the broadcasting implementation).

I consider it the most user-friendly part of the language: you get an amazing extension for free with a single character unified syntax. I don’t think things could get nicer than this.

Why would people choose Julia over Matlab/R/Python, if not for speed and elegance?

Creating yet another language that does not improve on existing ones would be pretty pointless.

This suggestion comes up very often from people misunderstanding the performance model of Julia. You can’t just “use it as an engine” and gain any of the benefits.

I think you are just overwhelmed with learning a new language that is different from the ones you used previously. Instead of recommending a fork or a redesign (which, TBH, is unlikely to gain traction anyway), I would suggest you just give it some time and things will fall into place.

28 Likes

Quick question: Why is writing loops not recommended and where can i read more about this? I’m a Julia beginner.

Sorry for hijacking the thread.

1 Like

Perhaps you misunderstood something: loops are perfectly fine, I was just suggesting them as an alternative if someone does not like broadcasting (for some reason, which is unclear to me).

6 Likes

Quite interesting discussion, I am usually trying to avoid loops, for me more readable is using map or transducers. Those are patterns from functional languages, there is a great documentation for Transducers.jl package. It’s just a matter of style but it might be worth trying if you are a beginner.

function do_something1(array)
    result = []
    for x in array
        if iseven(x)
            push!(result, 2x)
        end
    end
    return result
end

For me this is more concise:

function do_something2(array)
    return map(x -> 2x, filter(iseven, array))
end

using Transducers
function do_something3(array)
    xf = Filter(iseven) |> Map(x -> 2x)
    return collect(xf, array)
end
2 Likes

This is completely off topic, but I was always wondering how can you break of the map? If you add condition in the inner loop x > 10 && break is there a way to efficiently rewrite it in transducers or map approach?

I think so, transducers are awesome:

 xf = TakeWhile(x -> x <= 10) |> Filter(iseven) |> Map(x -> 2x)
5 Likes

Hmm…
Julia

A = rand(4, 8);
b = rand(8)';
c = rand(4);
D = @. exp(A ^ b) - log(c)

R

A <- matrix(runif(4*8), nrow = 4)
b <- t(runif(8))
c <- runif(4)
D <- exp(A ^ matrix(sapply(b, function(x) rep(x, 4)), nrow = 4)) - log(c)

EDIT: @qsong pointed out that this is a better way to write the last line:

D <- exp(A ^ rep(b, each = 4)) - log(c)

It gets worse as soon as you add (user defined?) functions that don’t have vectorized versions in R.

I’m presenting a 1-hour “Intro to Julia” session this Friday to a bunch of R users where I work.
Broadcasting was (and is) going to be one of my major selling points.

32 Likes

Well, I certainly seem to have hit a nerve! I kind of suspected I would be attacked on here for being ‘non-PC’. I would hope that at least some on here would appreciate what it took to put myself ‘out there’ like this, and ask that you please just hear me out.

Let me first reiterate and amplify what I started with above: Julia is a marvel.

However:

While I admit I can be a bit ‘thick’ at times, I did at one time I manage to do a 4-year MIT mathematics degree (with lots of EE/Compsci) in 3 years, with practically all A’s, so perhaps not that thick.

I write from the perspective of having taught literally thousands of students in numerical methods, applied statistics, machine learning, etc. at both the postgraduate and undergraduate levels. I have also written many (widely cited) research papers helped immeasurably by various numerical packages.

Having recently had experiences like spending an entire day debugging a Julia program, only to discover that my problem was having inadvertently initialised an array to integer zeros instead of floating-point zeros, I do not consider Julia (as it stands), a ‘user-friendly’ language.

I would really love to use Julia in my classes, but I do not feel that I can use it in good conscience, just as (in the past) I did not require students to use (plain) TeX until (the more user-friendly) LaTeX came along, as I did not require them to use R (or Splus) until R-Studio came along.

For my own work, I desperately need a user-friendly program that combines (and extends) the capabilities of MATLAB/numpy/R with the Performance of C++, and Julia is so almost those things, except for the user-friendly part. I need something so user-friendly I could (even) require MBA students to learn it, for example.

In no way am I suggesting that Julia needs to be changed; for reasons many of you highlighted it is just great the way it is. I am merely asking the question whether one might envisage a Wrapper for the many potential users who do not require the degree of elegance and sophistication to which Julia aspires, but who just need to do the basic things well.

Respectfully,

Compleat

2 Likes

Posting in an epic thread.

16 Likes

That’s a lovely example! :clap:t3:

9 Likes

Can you please go back and re-read the responses you have received in this thread. I just re-read the it myself, and did not find a single impolite response. This paragraph, however:

is in my strong opinion, way over the top. You are basically accusing the whole community of group-think and conspiratorial behaviour. And seemingly for no other reason than that people did not outright agree with you. Do you not see how insulting that paragraph is?

13 Likes

Perhaps a bit over the top, and (admittedly) not characteristic of the more constructive of the replies — I will edit (with apologies), if allowed.

1 Like

I’m curious what specifically you’d want to behave differently in the user-friendly variation of the language?

2 Likes

Better educational materials?

julia> zeros(2,5)
2×5 Array{Float64,2}:
 0.0  0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0  0.0

I recall running into that problem when I first started programming with Python.
Knowing that integers and floating point numbers are different would also help if using fill.

I would like a package to go further in trying to figure out what the user wanted… like my example above… if I am setting an array equal to a float, then it generally means I want it to be a float. If I add a constant to an Array and leave out a ‘.’, everything shouldn’t fall over. The whole mutability issue is beyond the needs of most users, the local/global as well… I could go on…(if you are interested)

You are not being attacked, and there is no “party line”. Claiming that people who responded to you are attacking you, or that they are representing something other than their individual opinion, is somewhat insulting. Please don’t do this.

I am very curious how you can do this inadvertently, as zeros defaults to Float64 unless you specify a type.

“User friendly” is a very subjective term that usually depends on the past experience of each user.

Undoubtedly, there are things about Julia that can be improved, but it may be more constructive to just give concrete examples (possibly with code), ideally opening an issue. Note that many existing issues are known and being worked on, so you may want to check that first.

Many people are using Julia in their courses (see Julia in the classroom). But of course you should not teach a language you have difficulties with, so this may be a reasonable choice.

4 Likes

Tamas, I have toned down the portion you quoted, though I did feel that many of the answers to my initial comment seem to be essentially calling me ‘stupid’. That was the context of my response.

As to how I ‘inadvertently’ initialised an array as integer 0’s, I merely multiplied an existing array (which I guess had been integer) by 0 (without the decimal).
a=0*b
[if you already have an array of the right size, this is much quicker]
but anyway, how I did this was not really my point.

I consider myslelf a fair judge of user-friendliness having taught so many students, and used so many languages/packages/interfaces, going back to Macsyma, even including weird ones like APL, and mind-numbing ones like COBOL…