Skip to content

Instantly share code, notes, and snippets.

@haxfn
Last active March 12, 2025 07:41
Show Gist options
  • Select an option

  • Save haxfn/327084e5e283c851ac00c76dfe48e806 to your computer and use it in GitHub Desktop.

Select an option

Save haxfn/327084e5e283c851ac00c76dfe48e806 to your computer and use it in GitHub Desktop.

langs.md

Julia

syntax

  • do blocks
    • note: don't clutter your function calls with calculations inside the argument placeholder
    • example:
    mynamedfunction(secondargument) do x_calculation
        2*x_calculation
    end

links

  • meshgrid is slow groups.google.com
    • note: julia loops are faster

      [!IMPORTANT]
      "Julia devs are working hard trying to make a language than is consistent and elegant, they don't want to add functions in Base only because they are convenient for people coming from a particular background when there's a more "Julian" way of doing it. Plus if you start adding matlab's function, why stop there? Add also R and python ones, you see it's not really a practical solution.

      The solution is to put all these in the matlabcompat package, so that people that are familiar with matlab can have all the familiar tools they need (meshgrid, interp1, polyfit, ...) without having to find, install and read the docs of 10 different packages. Since these functions are relatively simple, I'd encourage you to contribute to that package."

    • example:
      myresult = [myfunction(x, y) for x in xs, y in ys]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment