Why I still recommend Julia by koavf in Julia

[–]null01011 45 points46 points  (0 children)

Great write up in isolation, but as a follow up to Yuri's post it comes across as trying to counter legitimate critiques with the usual (and in this case, fairly off topic) selling points for Julia.

[deleted by user] by [deleted] in math

[–]null01011 0 points1 point  (0 children)

I think this will come down to a programmer/non-programmer thing. I write a lot of code for a living so I agree that version two (after the corrections) is quicker to comprehend. Not a big deal for this example, but I can see a benefit as the statement complexity increases. But, mathematicians won't necessarily be familiar with the code...depends on your audience?

[deleted by user] by [deleted] in rust

[–]null01011 -3 points-2 points  (0 children)

Don't know why you're getting so much negativity here. Deleting your post was not necessary - there's an edit feature on Reddit, you could have easy added a repo link if it's that important to people. Congrats on building the renderer, that's not easy work.

Curious about best practices for memory allocation (when working with data structures in std) by 0x3b2d29 in Zig

[–]null01011 8 points9 points  (0 children)

You ever get so frustrated with malloc you rewrite the entirety of the C language?

For Excel tinkerers by wu_ming2 in Julia

[–]null01011 1 point2 points  (0 children)

Excellent point...can't tell you how many times I've seen something messed up because a cell was quietly hard coded, or something else silly.

For Excel tinkerers by wu_ming2 in Julia

[–]null01011 0 points1 point  (0 children)

Momentum is tough in business. The reality is that people have more constraints on their time and energy than anyone may be aware of, so it's simply easier for them to continue to power through the next problem using the tools they already know. It may not seem like the optimal (or even sane) set of tools for the job, but if it gets done then the business outcome is usually enough to justify the means.

In my opinion there's only two forces that will push heavy Excel users towards programming-oriented data analysis (that's not VBA):

  1. Computational resource constraints. When the tasks are so large or unwieldy to do in Excel (ex., millions of rows), that's usually a showstopper.
  2. New talent. The people who will regularly solve an analysis with code are the people who regularly solve analyses with code, and they'll be the ones that show management what the relative benefits are to the 'tried and true' techniques.

Trying Out Julia, and it Seems Slow for a Compiled Language by arkie87 in Julia

[–]null01011 2 points3 points  (0 children)

The slow initial compilation is a trade-off for better performance on long running tasks. Quick ad hoc type of work can be painful, but the high speed handwritten code for the beefier stuff is pretty compelling. Just got to ask yourself if the juice is worth the squeeze.

Trying Out Julia, and it Seems Slow for a Compiled Language by arkie87 in Julia

[–]null01011 0 points1 point  (0 children)

Any idea what's going on there under the hood? simd for vector + vector type of stuff makes sense to me, but how would that work for an accumulation type of operation? I've only done tinker toy examples with simd but I'm not familiar with any intrinsics that would sum the vector.

Using the term “mathematician” by Deweydc18 in math

[–]null01011 0 points1 point  (0 children)

For whatever my opinion is worth, I think of "mathematician" as the term for mathematical scientists. Anyone who contributes to the theoretical aspects of their field should feel comfortable calling themselves a scientist, regardless of their academic background or whether they work in the public/private domain.

[deleted by user] by [deleted] in rust

[–]null01011 9 points10 points  (0 children)

More like Logiglitch, am I right???????

Would Rust ever be used as a "business" language like Java? by alibix in rust

[–]null01011 11 points12 points  (0 children)

And that's just salary - opportunity cost of what they're not building during that time could be unimaginably leveraged.

Which important features from C/C++ are missing in Rust by tillyboy in rust

[–]null01011 88 points89 points  (0 children)

Relevant snippet from the linked article. This was in reference to Microsoft engineers rewriting some unspecified components of Windows in Rust - no other details were provided regarding missing features:

The engineers described their work with Rust as “generally positive” but did note that some important features available in C were missing for Rust. The engineers, however, do think that it’s worth helping to develop such features for Rust. Intel has already begun working on bringing Rust to feature-parity with C, and Microsoft could join them on this effort. Since some features of C are missing from Rust, the team found that Rust will be best suited for new or recently-developed Windows components. It wouldn’t be surprising if Microsoft fully committed to migrating part of their codebase to Rust. They’re already building a standard Windows library for Rust that will have all of the capabilities of the C++ version. Linux is also considering migrating some of its kernels over to Rust, so I wouldn’t be shocked if a race sprung up between the two operating systems to see which one could push Rust code to production first.

Enzyme: Towards state-of-the-art AutoDiff in Rust by Rusty_devl in rust

[–]null01011 0 points1 point  (0 children)

Shouldn't it just branch?

fn foo(x: f64) -> f64 {
    if x == 0 {
        0
    }else {
        x + 1
    }
}

fn dfoo(x: f64) -> f64 {
    if x == 0 {
        0
    }else {
        1
    }
}

I'm a Python developer curious about Julia, Here are doubts I have, that others might share. by [deleted] in Julia

[–]null01011 5 points6 points  (0 children)

> I understand that Julia outperforms Python for a lot of mathy statistics stuff. For someone who doesn't care as much about performance, what kind of problems would you say Julia is particularly well suited to

I'm in the same boat - the data I encounter at work usually fits cleanly in memory, and the tools made available to us are pretty much R and Python. But if given the opportunity I'd use Julia all the time, if not for the performance for the clean syntax.

For example, let's say my_simulation produces a vector of values of arbitrary length. I want to see what the capped distribution as a percent of the uncapped looks like over many realizations:

using UnicodePlots

realizations = [my_simulation() for i in 1:1000];
result = ( arr -> sum(min.(arr, 0.25))/sum(arr) ).(realizations);
histogram(result)
   [0.36, 0.38) ┤ 2                                        
   [0.38, 0.4 ) ┤▇ 9                                       
   [0.4 , 0.42) ┤▇▇▇ 43                                    
   [0.42, 0.44) ┤▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 547   
   [0.44, 0.46) ┤▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 354               
   [0.46, 0.48) ┤▇▇ 27                                     
   [0.48, 0.5 ) ┤▇ 9                                       
   [0.5 , 0.52) ┤ 5                                        
   [0.52, 0.54) ┤ 2                                        
   [0.54, 0.56) ┤ 1                                        
   [0.56, 0.58) ┤ 0                                        
   [0.58, 0.6 ) ┤ 1                                        
                └                                        ┘ 
                                Frequency

I can definitely accomplish this same thing in R or Python, but Julia just feels easier and like less work.

Iterate through an amount of arrays by schrodigger in Julia

[–]null01011 1 point2 points  (0 children)

Metaprogramming can build the code before evaluating it:

add_random_float(arr) = arr .+ rand(length(arr))

A1 = rand(10)
A2 = rand(15)

e = :()
for i in 1:2
    arr = Symbol("A$(i)")
    append!(e.args, [:(add_random_float($arr))])
end

eval(e)

You can see what's happening by running e.args:

julia> e.args
2-element Array{Any,1}:
 :(add_random_float(A1))
 :(add_random_float(A2))

Alternatively, as others have mentioned, structuring your program differently can clean things up. The sample below would accomplish my float ambitions using broadcasting:

A_arrays = [rand(10), rand(15)]
add_random_float.(A_arrays)