I don't identify as a msft shill, but I also don't _hate_ them (at least not any _more_ so than $OTHER_TECH_COMPANY). VSCode is *the* supported IDE for Julia and has the backing of the Julia devs so it is really is the best option hands down (at least in my opinion).
Vim likely won't ever stack up to vscode in terms of integrated debugging, intellisense and code navigation, and other quality-of-life / nice-to-have features because from what I have seen, the Julia devs are focusing on adding these features to VSCode and not other editors (vim).
If you're willing to entertain a compromise, you can try VSCodium. This is an open fork of Msft's VSCode (which is open source and licensed under MIT) with msft telemetry disabled. You can take a look here: https://vscodium.com/
From this julia-users thread, we learn from Stephan Karpinski that >The AV crew was actually paid and they're actively working on the videos, so that should be done soonish. Will let everyone know once it's done, of course. I'm eager to see them too since the conference was 1.5 track and I couldn't see all of the talks!
That statement was made July 2nd...
I prefer PlotlyJS.jl over Plots.jl. It's a thin wrapper to (Plotly)[https://plot.ly/javascript/] so you can rely on their documentation plus a few syntax tips. Getting to a simple plot is slightly more verbose than in plots, but I find it way easier to customize.
> I’m the first to bemoan the fact that it’s come to be pronounced like the female first name, as opposed to the French pronunciation of its namesake, the mathematician Gaston Julia.
Is this actually even true? Evidence to the contrary here.
In this Channel 9 video interview it is answered by Stefan and Jeff, at 18:45. Basically there is no real reason, it just sounds nice. Still worth watching the video though.
Hands-On Design Patterns and Best Practices with Julia by Tom Kwong is a useful book for learning Julia's core features and style.
link has nothing to do with julia.
i don't think anyone thinks julia doesn't need a native debugger. as far as i remember it's waiting on some patch related to llvm.
edit: dug out this thread - https://groups.google.com/forum/#!searchin/julia-users/andrew$20cooke$20debug/julia-users/zEqWxn7HDVo/ZTRZh4ziR9kJ with quote "the longer term approach to debugging Julia code is to switch to using LLVM's MCJIT for code generation, which, among other things, supports emitting DWARF debug information, thereby allowing C-style debuggers to work with Julia code."
Speaking of which, it would be nice to see some new posts in that Julia blog. Year 2012 has 7 posts, 2013 has 8, and 2014 has only 3. Someone might get the impression that the wonderful enthusiasm shown in "Why We Created Julia" has waned already! A suitably overenthusiastic post on staged functions or some other must-have feature of 0.4 wouldn't go amiss.
I'm totally new to Julia, and I like to learn using coding exercises. I noticed exercism.io didn't include Julia yet, so I asked about getting a new track set up.
Obviously, since I don't know the language yet, I'm not the most qualified to get things going. There are a few things that need to happen before it's ready to go:
Implementing a handful of exercises – you can look here for descriptions and test data for ones that are common in other languages on the site.
Documentation for installing Julia, learning resources, etc.
A couple people interested in acting as mentors to provide feedback on exercises need to step up before the track can be launched officially, but people will still be able to practice using the exercises before then.
I can pitch in on some level, but I'm hopeful you'll be interested too!
I think that it is fine to be critical, but your style in doing so is different in a couple of respects from what I'd recommend.
One potential issue is that you have a tone that can be interpreted as challenging on a personal level. Perhaps you were trying to say that I've just not seen Julia's limitations because I've not looked in the right places. But overall, it sounded as if you were saying that I'm just not sophisticated enough (as a programmer) to see the problems and that my work is just sloppy one-off scripts. I chose to ignore that tone and carefully avoided acknowledging or engaging those points in my reply. In general it's counterproductive get into shouting matches over skill, competence or character.
Perhaps you should be more specific in your comments and try to engage with Julia on Julia's terms. Those comments of yours that I've seen here are very sweeping and sound as if they come from an outsider who hasn't, say, read any of Julia's design papers, and is trying to make Julia look like some other language (Python perhaps). Broad generalizations not sustained by an understanding of Julia's design goals are liable to fall on deaf ears. Please note, I'm not saying that you aren't knowledgeable of Julia and an experienced developer. It's just that you haven't make your level of Julia expertise and engagement clear to me in the comments that I've seen.
Try to think about how a complete stranger might view your comments. Try to make that stranger your friend.
That assertion failure is coming from LLVM, probably because the LLVM ptrtoint
instruction is supposed to convert to an integer type. http://llvm.org/docs/LangRef.html#ptrtoint-to-instruction
Julia is apparently generating invalid LLVM code for this?
julia> f1(a) = reinterpret(Float64, pointer(a)) f1 (generic function with 1 method)
julia> f2(a) = reinterpret(Float64, reinterpret(Int64, pointer(a))) f2 (generic function with 1 method)
julia> @code_llvm f1(a)
define double @julia_f1_21195(%jl_value_t*) { top: %1 = bitcast %jl_value_t* %0 to i8** %2 = load i8** %1, align 8 %3 = bitcast i8* %2 to double* %4 = ptrtoint double* %3 to double ret double %4 }
julia> @code_llvm f2(a)
define double @julia_f2_21196(%jl_value_t*) { top: %1 = bitcast %jl_value_t* %0 to i8** %2 = load i8** %1, align 8 %3 = ptrtoint i8* %2 to i64 %4 = bitcast i64 %3 to double ret double %4 }
$ julia _ _ _ ()_ | A fresh approach to technical computing () | () () | Documentation: http://docs.julialang.org _ _ _| | __ _ | Type "?help" for help. | | | | | | |/ ` | | | | || | | | (| | | Version 0.5.0 (2016-09-19 18:14 UTC) _/ |_'|||_'| | Official http://julialang.org/ release |_/ | x86_64-apple-darwin13.4.0
julia> @time using Plots, DataFrames 1.183326 seconds (1.38 M allocations: 63.092 MB, 3.66% gc time)
julia>
My computer's really old. Well, mid 2011 iMac. But 1.18 seconds isn't unbearable... :)
You can check out Escher if you are looking for a Web UI. https://github.com/shashi/Escher.jl
There are a couple of blog posts on the same by Tim Holy, although it is kinda old. http://julialang.org/blog/2013/05/graphical-user-interfaces-part1/
From the first line of the Julia webpage: "Julia is a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users of other technical computing environments." In other words, the current focus is indeed on academics and data scientists.
Also, I don't think you really intended this so literally, but I wouldn't say that "Matlab users have for years and years" been "mostly focused on achieving better computational performance." Matlab is a high-level language for rapidly developing algorithms, some of which run quite fast. Matlab's performance is acceptable to many, but except for code that's mostly linear algebra, there are usually alternatives that can do better. In development time vs. execution time, Matlab favors the former.
Sorry about that, perhaps 'glue' wasn't the exact right term in this case. Couldn't think of a better description though, using Julia to run routines on 3 different systems.
Here's a blog post from the main Julia blog that covers calling C from Julia.
On 0.4-dev commit45f9cc5
I get the following error message:
julia> reinterpret(Float64, pointer(a))
LLVM ERROR: Cannot select: 0x7fcb4c8abb10: f64 = truncate 0x7fcb4c8bfa10 [ORD=30570] [ID=5]
dbg:essentials.jl:115:1
0x7fcb4c8bfa10: i64,ch = CopyFromReg 0x7fcb4bc234e8, 0x7fcb4c8a9a10 [ORD=30570] [ID=4]
0x7fcb4c8a9a10: i64 = Register %vreg1 [ORD=30570] [ID=1]
In function: julia_reinterpret_21112
I have no idea what's up. You should ask the Julia users mailing list about this, or even file an issue on GitHub -- my superficial searches haven't pulled up anything related.
Ah right, now I remember: you're always working on nigh-impossible fluid dynamics. Great if the language gets out of your way.
Haven't played with the languge enough to give you any advice on the parallelism, but if you haven't asked there yet then I guarantee that the google group for Julia will have your confusion cleared up within a day or two. Many of the regulars there seem to know the language down to the metal, and usually they're super-fast in answering questions.
How are you using Julia? Command line, iJulia, Lighttable plugin? In the latter two the plotting libraries seem to work better (plus, dat LaTex autocomplete).
I was thinking of conda itself, which the package you linked to seems to work with. I haven't used conda to manage an environment for Julia, so I'm not able to evaluate the need for Conda.jl.
Ah, that’s what I thought but wanted to confirm. I think it’s awesome to try to do things from scratch, but I was a bit puzzled when you mentioned this. LightGraphs.jl I believe is a package meant for graph theory work (which I know almost nothing about), not to be confused with plotting. If it’s just plots in the terminal you’re after, checkout UnicodePlots.jl.
Other REPL goodies: OhMyREPL, TerminalPager, REPLTreeViews, and I’m sure there are others. Some of them compose quite nicely: https://asciinema.org/a/2XMWIinOJj32Xn9A5uu3wBrlm
Sublime Text + iTerm on OS X. Terminal split into two panes vertically, left one for running the script in development, right one with Julia REPL for trying things out. I use this same workflow for both local and remote files that I am working on.
I have the Julia documentation at my fingertips with Dash, and I have a custom keyboard map that has all of the greek letters bound to alt+something so I can easily name variables ρ, α, Σ, etc.
For debugging, I have a lot of info
statements in the section of code I am working on and a few @assert
s scattered around the place, and make heavy use of type assertions.
Atom or VSCode — have you used multi-cursor?
Such a tiny joy! :)
Very useful when playing with code initially before you’ve made it super clean and need to change references, etc.
VSCode has a nice quick overview of useful shortcuts when you start it up.
(I used to use Atom too and miss its adorable tentacles self, but Atom was bought by VSCode’s owners (Microsoft) and more and more dev work is just focused on VSCode now - including Julia’s main IDE integrators as I understand.)
Note: you can also get VSCodium if you want an open source only version of VSCode.
Julia is a great first language imo. Much like Python it is very transient and readable. Indeed, basic Julia reads almost just like outlook, but even more clearly I think. (as it’s more functional and less object oriented in style — those those things may not mean shouting to you if you’re new to programming && and if you want to do numeric a lot of that is in the base language vs requiring specialized libraries)
It’s a significant added bonus, imo, that Julia gives you more room to grow than Python if you want — Learning about custom types, removing safety features for speed, macros, etc. But there’s no rush to that. You can just use it as a nicer Python and it’s a great first language.
Think Julia is a great resource if you’re new to programming. Also made free online by the author if you need
1.0+ are fine.
In particular I can recommend Think Julia and Julia for Beginners
For what it’s worth the latter (JfB) was just completed a few days ago and so is likely very recent. (I started reading it s couple months back when it was near completion).
I have to admit, when I first installed VS Code, I had no idea what to do with it (as a non-programmer). These days, I do most of my coding in it...Julia, Python, SQL. I’m still learning my way around it, and it has some rough edges here and there, but it’s otherwise an amazing piece of free software that works just as well on Linux, for me, as it does on Windows. The multi-cursor editing is one of the killer features for me (huge for SQL editing in particular where you’re repeating yourself a lot), along with being able to refactor a variable with F2. Julia REPL integration is really good, and even though it’s not quite as a complete package as RStudio is, I think it comes close enough.
Yesterday I started learning a bit of C (“a bit” being the key world as all I did was “Hello World”), and it was great for that: nice syntax highlighting in the editor, terminal right there on the right for compiling and running.
In case you don’t know, Ctrl+Shift+P or F1 opens the Command Palette. There you can simply type “repl” and then you’ll see a command to start the REPL. On Mac I think it’s just Cmd P or F1. https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf
Hi Peter. Very true, public download numbers would probably be the best gauge, if those are being collected via conda (or pip? 8200/month according to pypi). The most worrying thing I've seen about numba is that it apparently doesn't handle user-defined types? https://groups.google.com/a/continuum.io/forum/#!topic/numba-users/TVal1Xfw6kw Being fast on basic scalar built-in types and dense N-D arrays thereof is a starting point, but library authors need specialized data structures.
Yeah. Viral noticed over at https://groups.google.com/forum/#!topic/julia-users/RzEn0PoOFp4, that:
"I don’t know why the slides are missing. Perhaps Jiahao or Andreas may know. I do recollect that there were a few hiccups in some of the talks with the recording.
-viral"
This is down to my ignorance of how Macs work, but doesn't it use a similar PATH
system to Windows and Linux? To answer my own question, looks like it does: http://osxdaily.com/2014/08/14/add-new-path-to-path-command-line/
So if you want to change what is opened when you type julia
on the command line then I assume you can just prepend the directory of the version you want to your path.
>code_warntype
I wish there were a version of code_warntype that didn't show the lowered code but showed the original code, along with caught warnings.
Actually even better is how TypeScript handles various arcane rules in JavaScript, which has odd variable/lexical scope rules:
https://www.typescriptlang.org/docs/handbook/variable-declarations.html
For the most part, typescript catches those types of errors (as you edit things) and directly makes it visible in the editor.
I think all of this is possible in Julia, but it requires much better integration between editors and the LSP and the core language or linters.
I've done some programming in kotlin and really liked this idea of decoupled language frontend and backend. I wish Julia had a compiled and interactive backends instead of JIT.
That is not correct.
Check out test3! in https://repl.it/repls/AdorableHiddenDribbleware
Even if you call test3! with a mutable array, the assignment x = 0 does not mutate the array.
The problem isn't immutable vs mutable, the problem is that "x =" creates a new binding, while x[1] = or x .= mutate.
"x =" is not a mutating operation.
Here is an example of this in action, with "a.x =" which is also mutating:
Wow, a few interesting answers here.
Julia is used for mathematics, don't try to use it for learning programming. Instead, go to Codecadamy and take the python course. http://www.codecademy.com/tracks/python
Some details were posted by David Sanders over at julia-users. Here are the IJulia notebooks that he used.
Chocolatey is, or at least was last I checked, one of the best package manager-equivalents on Windows. And it has Julia: https://chocolatey.org/packages/Julia
Although if you have to use windows it is probably easier to just use WSL to handle programming dependencies and packages.
Non-Microsoft option: https://vscodium.com
VSCode is almost open source. It’s mainly open source code with a little bit extra Microsoft thrown in.
VSCode is just someone compiling the open source binaries for VSCode, minus Microsoft proprietary code and telemetry and making it available.
why not eg, download/install Atom and Atom Beta (https://atom.io/beta)? use one for Julia/Juno, and the other for everything else--these two will live side-by-side; one is not going to over-write the other. This is a common setup for contributors--eg, hack on the Beta, and use the stable release for as their general purpose editor.
It would be pretty easy to build a table view as an atom plugin. There are things like tablr already so it might be possible to integrate that with DataFrames in future.
Care to explain what finalize and serialize do? The only thing the docs say is Register a function f(x) to be called when there are no program-accessible references to x. The behavior of this function is unpredictable if x is of a bits type.
Have you tried to use https://www.techpowerup.com/gpuz/ for GPU monitoring?
To install Julia with command line access (and updating it) I suggest to use brew cask
, which, together with brew, is quite useful for development on the Mac.
Otherwise, you can find the Julia executable in Contents/Resources/julia/bin/julia
inside the app bundle under Applications and then either add the directory to the path, define an alias, or make a symbolic link in a directory inside the path.
This example is irrelevant, since it only involves singular dispatch. Futhermore, it seems to me the generalization of this example would be better handled by multimethods and/or predicate dispatch rather than type-based dispatch.
You’re accustomed to the edit-compile-run-debug model of C (and Pascal, Java, Rust, and Fortran). Julia comes from the much higher-level tradition of Lisp, and the REPL is part of it. Try reading the Why REPL section here: https://clojure.org/guides/repl/introduction
While you can use an editor and terminal to write Lisp and Julia code, as you discovered, it feels awkward. So you should use an editor which has a mode for talking to the REPL. Julia has plugins for Atom and VS Code. I wrote one for Emacs. If you’re a vi user, I’m not aware of a native Vim plugin, but you can use Emacs in vi-emulation mode (see Doom Emacs for a nice distribution).
Don’t disparage REPL integration as a lame IDE. It’s a different level of thinking about how you interact with the program under development, and it happens to require a different set of tools. Like a sci-fi powered exoskeleton, it helps you move faster.
By the way: Python, Ruby, Node, and Haskell all have REPLs, but REPL-driven development did not take off in those languages, and necessary editor modes don’t exist, except in odd form like Jupyter for Python /¯\_(ツ)_/¯
Distribution in binary form is a pain point for Julia. It’s also a pain point for Java and Python: ya gotta ship the whole runtime environment. All 200+MB of it for “hello world”. Fun. But it’s also a pain point for C and C++. That a.out
binary is probably dynamically linked to libc
. What if the end user’s machine has an incomparable C “standard” library? That’s why Windows programs, such as games, often force installing the exact version of the Visual Studio runtime they were written for.
>using Pkg
>
>Pkg.add("Genie")
Thanks, that worked to install the package.
But then when I proceeded to julia> using Genie.Router
I got "UndefVarError: julia not defined" again.
Edit- I know I'm probably missing something incredibly obvious and should probably just learn more Julia syntax. This is what I'm using, if it's relevant.
>As of IPython 4.0, the language-agnostic parts of the project: the notebook format, message protocol, qtconsole, notebook web application, etc. have moved to new projects under the name Jupyter. IPython itself is focused on interactive Python, part of which is providing a Python kernel for Jupyter.
IPython itself is only focused on interactive python, not anything else. The "kernel" aspect of the project was switched to Jupyter a while ago. Of course they update IPython regularly as it serves as the kernel for Jupyter.
Have you tried Jupyter ?
You write your code in cells and you can run one cell or all of them. It’s really nice, very interactive. Cells can be text, images, latex equations and more.
The way I've been running it is actually in what I used to know as IPython notebook. It's called Jupyter: https://jupyter.org/
You install IJulia and Anaconda (or equivalent packages), and then you can run Julia in the notebook. I think there is R support in there also, but I'm actually not sure if you can move between one and the other in the same notebook.
Unfortunately Nim also dropped multiple dispatch towards the 1.0 release, supporting only a compile flag enabling a dynamic dispatch implementation. And multiple dispatch work so well in Julia because the entire language (from the compiler to the standard library to the ecosystem) is designed to support and encourage it, it's not something that could have been made as an extra and have the same results.
Look very nice but I wasn't able to compile it on a fresh 0.6 julia (Ubuntu 16.04). Any ideas why?
lali@TITAN-L:~$ julia --color=no _ _ _ ()_ | A fresh approach to technical computing () | () () | Documentation: https://docs.julialang.org _ _ _| | __ _ | Type "?help" for help. | | | | | | |/ ` | | | | || | | | (| | | Version 0.6.0 (2017-06-19 13:05 UTC) _/ |_'|||_'| | Official http://julialang.org/ release |_/ | x86_64-pc-linux-gnu
julia> using GtkIDE
INFO: Precompiling module GtkIDE.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgtksourceview-3.0-1 is already the newest version (3.18.2-1).
libgtksourceview-3.0-1 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
(julia:7883): GtkSourceView-ERROR **: Error while loading the completion UI: .:23:106 Invalid object type 'GtkSourceCompletionInfo' ERROR: LoadError: Failed to precompile GtkSourceWidget to /home/lali/.julia/lib/v0.6/GtkSourceWidget.ji. Stacktrace: [1] compilecache(::String) at ./loading.jl:703 [2] _require(::Symbol) at ./loading.jl:456 [3] require(::Symbol) at ./loading.jl:398 [4] include_from_node1(::String) at ./loading.jl:569 [5] include(::String) at ./sysimg.jl:14 [6] anonymous at ./<missing>:2 while loading /home/lali/.julia/v0.6/GtkIDE/src/GtkIDE.jl, in expression starting on line 9 ERROR: Failed to precompile GtkIDE to /home/lali/.julia/lib/v0.6/GtkIDE.ji. Stacktrace: [1] compilecache(::String) at ./loading.jl:703 [2] _require(::Symbol) at ./loading.jl:490 [3] require(::Symbol) at ./loading.jl:398
julia>
Can you open up a REPL and reproduce the brackets? I am surprised you're getting brackets in this situation. Check it out:
_ _ _ ()_ | A fresh approach to technical computing () | () () | Documentation: http://docs.julialang.org _ _ _| | __ _ | Type "?help" for help. | | | | | | |/ ` | | | | || | | | (| | | Version 0.5.0 (2016-09-19 18:14 UTC) _/ |_'|||_'| | Official http://julialang.org/ release |_/ | x86_64-w64-mingw32
julia> dict = Dict{Int, Vector{Int}}() Dict{Int64,Array{Int64,1}} with 0 entries
julia> for i in 1:3 dict[i] = [i,i,i] end
julia> typeof(dict) Dict{Int64,Array{Int64,1}}
julia> dict Dict{Int64,Array{Int64,1}} with 3 entries: 2 => [2,2,2] 3 => [3,3,3] 1 => [1,1,1]
julia> for el in dict[1] println(el) end 1 1 1
julia>
Edit: if you want to print the array on one line sans brackets you can do something like
julia> for el in dict[1] print(string(el) * " ") end 1 1 1
I guess you're on Windows? There's been a fair bit of work on that. You could try is checking out a nightly build to see how much things have improved – if there are any more issues you still have time to complain ;)
Ok, I recommend trying out the instructions for Ubuntu here – halfway down the page you'll see instructions for installing using the PPA. Once you've done that you should be able to use Julia from the terminal, and setting the path in LT won't be necessary.
I agree with documentation + coding challenges combo.
Codewars also has 392 problems in Julia: https://www.codewars.com/kata/search/julia?q=&&beta=false&order\_by=total\_completed%20desc
I downloaded Visual Studio, and it comes with a compiler for C/C++(https://visualstudio.microsoft.com/). But you can also download gcc compiler (https://gcc.gnu.org/).
Visual studio is the whole IDE (text editor with steroids), gcc is just the compiler.
I just published this post, and I was looking for some feedback and discussions on parallel & distributed programming in Julia!
The post is written in Org mode, and the data and code are all hosted on this GitHub repo.
If you’re newish to programming in general then I recommend Think Julia - physical book or Think Julia - free web book.
Super short, to the point, but very friendly book. Small number of reasonable exercises (so you don’t need to stress over which ones to do) — and it covers general thinking for how to go about solving problems and debugging for people new to programming.
Haha I'm not actually a Haskell user. I'm coming from a C++, Python, and Matlab background, and I can understand the want for efficiency. I recently started reading Structure and Interpretation of Computer Programs (uses Scheme). I'm new to functional programming in general. I wanted to grapple with it in Julia.