From Julia to Rust

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • egg

    egg is a flexible, high-performance e-graph library (by egraphs-good)

  • I specifically mentioned the `egg` crate because of it's capabilities for symbolic math: you can check a minimal application of it in their repo here:

    https://github.com/egraphs-good/egg/blob/main/tests/math.rs

  • JET.jl

    An experimental code analyzer for Julia. No need for additional type annotations.

  • - Pattern matching (sometimes you don't want the overhead of a method lookup)

    [1]: https://github.com/aviatesk/JET.jl

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • SumTypes.jl

    An implementation of Sum types in Julia

  • > Pattern matching

    MLStyle.jl [1] is quite nice for this and has been around for a while.

    > Tagged, closed unions

    These are less general than 'real' unions and can be implemented using them. E.g. SumTypes.jl [2] has some macros to make it a bit more convenient to define them, it could use some other quality of life features though.

    [1] https://thautwarm.github.io/MLStyle.jl/latest/syntax/pattern...

    [2] https://github.com/MasonProtter/SumTypes.jl

  • Octavian.jl

    Multi-threaded BLAS-like library that provides pure Julia matrix multiplication

  • > The biggest reason is because some function of the high level language is incompatible with the application domain. Like garbage collection in hot or real-time code or proprietary compilers for processors. Julia does not solve these problems.

    The presence of garbage collection in julia is not a problem at all for hot, high performance code. There's nothing stopping you from manually managing your memory in julia.

    The easiest way would be to just preallocate your buffers and hold onto them so they don't get collected. Octavian.jl is a BLAS library written in julia that's faster than OpenBLAS and MKL for small matrices and saturates to the same speed for very large matrices [1]. These are some of the hottest loops possible!

    For true, hard-real time, yes julia is not a good choice but it's perfectly fine for soft realtime.

    [1] https://github.com/JuliaLinearAlgebra/Octavian.jl/issues/24#...

  • Catlab.jl

    A framework for applied category theory in the Julia language

  • The biggest group outside of numerical computing in Julia land are the PL and systems people though? This includes type theorists [1], database folks [2], distributed systems people ([3] to name just one). There are also a fair number of compiler nuts, hence the existence of multiple projects [4][5] in this space. And this is before getting into things that bridge more than one of the domains above, e.g. [7] or [8].

    FTR, I think it's fair to question whether numerical computing should have an outsized influence on the direction of the language. I also think it's a pretty fair comparison to point out how standardized and consistent the Rust governance process is compared to Julia's (the Rust RFC system is an exemplar here). That doesn't mean there is a dearth of PL and systems knowledge in the Julia community though.

    [1] https://github.com/AlgebraicJulia/Catlab.jl

  • Dagger.jl

    A framework for out-of-core and parallel execution

  • IRTools.jl

    Mike's Little Intermediate Representation

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • MacroTools.jl

    MacroTools provides a library of tools for working with Julia code and expressions.

  • Metatheory.jl

    General purpose algebraic metaprogramming and symbolic computation library for the Julia programming language: E-Graphs & equality saturation, term rewriting and more.

  • Symbolics.jl

    Symbolic programming for the next generation of numerical software

  • julia

    The Julia Programming Language

  • Sure, I'll just list a few things that come to mind.

    A stronger culture of functional programming would make your code faster and easier to understand. It's easier for tooling to optimize pure functions over immutable data structures (and arrays). Arrays are currently mutable, and there are too many mutating functions.

    Higher-order functions are untyped, which means it's hard to abstract out the key properties that enable reuse, optimizations, and parallelism. See [0] for a language expert's take on numerical computing, which involves defining traits like associativity that enable automatic parallelism by default.

    The iteration protocol could have done things differently for efficiency on large collections [1].

    Macros are useful for high-performance computing, but Julia's macros are hard to compose [2].

    Base has a ton of random stuff that never got an opportunity to mature before locking into 1.0 -- a more conservative base library would have less stuff and be easier to use for everyone.

    In general, Rust doesn't make language decisions lightly. They have committees, discuss how other languages do things, make proposals. This allows more perspectives on each decision. That would be a good replacement for the ad-hoc style of Julia development.

    [0] https://www.youtube.com/watch?v=EZD3Scuv02g

    [1] https://mikeinnes.github.io/2020/06/04/iterate.html

    [2] https://github.com/JuliaLang/julia/issues/37691

  • StaticArrays.jl

    Statically sized arrays for Julia

  • 2. Persistent data structures as found in most FP languages.

    Note how neither of these capture the large, (semi-)contiguous array types used for most numerical computing. These arrays are only "easier to optimize" if one has a Sufficiently Smart Compiler to work with. Here we don't even need to talk about Julia: the reason even Numba kernels in Python land are written in a mutating style is because such a compiler does not exist. You may be able to define something for a limited subset of programs like TensorFlow does, but the moment you step outside that small closed world you're back to needing mutation and loops to get a reasonable level of performance. What's more, the fancy ML graph compiler (as well as Numpy and vectorized R) is dispatching to C++/Fortran/CUDA routines that, not surprisingly, are also loop-heavy and mutating.

    Should Julia do a better job of trying to optimize non-mutating array operations? Most definitely. Is this a hard problem that has consumed untold FAANG developer hours [2] and spawned an entire LLVM subproject [3] to address it? Also yes.

    > The iteration protocol can be made more memory-efficient for large collections and simpler...

    Yup, this has been a consistent bugbear of the core team as well. The JuliaFolds ecosystem [4] offers a compelling alternative with fusion, automatic parallelism, etc. in line with that blog post (which, I should note, is a much different beast from Rust's iterator interface/Rayon), but it doesn't seem like the API will be changing until a breaking language release is planned.

    > In general, systems languages don't make language decisions lightly. They have committees, discuss how other languages do things, make proposals. This allows more perspectives on each decision. That would be an improvement over the more ad-hoc style of Julia development, as long as Julia can avoid adding every possible feature, which is a risk of expanding the decision-making body.

    I'd argue this is a property of mature, widely used languages instead of systems languages. Python, Ruby, JS, PHP, C# and Java are all examples of "non-systems" languages that do everything you list, while Nim and Zig (note: both less well adopted) are examples of "systems" languages that don't have such a formalized governance model.

    Julia (along with Elixir) are somewhere in between: All design talk and decision making is public and relatively centralized on GitHub issues. There is no fixed RFC template, but proposals go through a lot of scrutiny from both the core team and community, as well as at least one round of a formal triage (run by the core team, but open to all). Any changes are also tested for backwards compat via PkgEval, which works much like Crater in Rust. There was a brief effort to get more structured RFCs [5], but I think it failed because the community just isn't large enough yet. Note how all the languages with a process like this are a) large, and b) developed it organically as the userbase grew. In other words, you'll probably see something similar pop up when the time savings provided by a more structured/formal process outweighs the overhead of additional formalization.

    [1] https://github.com/JuliaArrays/StaticArrays.jl

  • glow

    Compiler for Neural Network hardware accelerators (by pytorch)

  • Juleps

    Julia Enhancement Proposals

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts