One of most frequent questions that I get from people interested in Julia, for example on the chat of “Julia Beginners AMA”, is “Is Julia good for web-development?”. I’m not into web-development, so I don’t have knowledge to give well thought answer. I know that part Julia community is active that field, but at this my knowledge pretty much ends.
I think that I encounter this question so often, that is worth considering how non-web-developer Julia user should respond to it. My personal, non-expert opinion is that, if what you need is language for web-development you should learn Go, which is great, minimalist, elegant, stable language tailored for writing web servers at Google. But, this is only my opinion, I can be wrong.
I am also not a web developer, but I know there are some pretty cool things being done in Julia in that area. I will let those who are more active in the area provide their comments, but I will just link you to some of the cool projects.
For building static webpages:
For building reactive dashboards:
For general web development:
There are many others! I would put Pluto.jl in the mix here too.
You are probably right that for many web development things, Julia might still lag behind the existing frameworks in other languages, but it is moving forward very quickly.
Thank you for this. I will probably ask developers of this packages how this works/feels in practice.
It is easy to notice that Julia and Go feels very different. And should feel these way, they are designed in very different ways and newcomers should know if these differences matters for them. Putting some syntax aside I will stated my viewpoint on some of them.
Go is minimalist. It have probably less keywords than C and one of Go rules seems to “don’t alter language, don’t add a features, write more libraries”. Story of DIDn’T adding generics to Go can probably fill a book. Since I believe in KISS principle I admire they dedication to keep language simple and clean, if these mean spending 10 years of so debating about these one thing.
Even Jeff Bezanson agree there are things in Julia, that you can do in too many ways. And new features are coming.
Go is guarding you all the time. Unused variable? Compilation error. Unused import? Compilation error.
Julia. Unused variables and import can be quite useful in the future.
Go. 0 + 0.0? Compilation error, since there is no implicit type conversions. You must think what you do.
Julia. 0 + 0.0? Call the method of + that do it quickly.
Go. There is no overloading of operators like +, since “clear is better
than clever”. If you need some new operation, write a function.
Julia. Operation + have 100 or so method from the start and you can add your one at will.
2021 and we may add generic to Go this year (see post above).
Julia Any or something like that should be good enough.
Go compiler must compile code fast, so it is. (Maybe Tiny Go is not, but this is side project, not canonical Go compiler.)
Julia. Is LLVM slower again? Hopefully combined with our work, Julia compilation time will decrease a bit.
Go. Exceptions are evil, errors are just values, this way you have all powers of language to your disposal to deal with them. Did I mention that ternary operator also is evil?
Julia have exceptions and ternary operator.
Go code from v. 1.0 should compiled in version 1.999, if such one will be created.
I never check code stability in Julia to be honest.
I will summarize these like that. Julia is flexible, Go is rigid by design. In the case of Go these rigidity is feature not a bug, since rigidity means predictability, reusability and make safety easier to achieve. These must be very important in things like writting servers, since these is canonical Go program. Is it important in web-development? I really want to know.
I think the biggest issue regarding Go and Julia for web service work is the availability of high quality libraries for everything you need to do. There are maintained Go libraries (and often multiple choices) for every conceivable database, message system, protocol, format, etc that you can imagine, often from the source of the technology. It comes down to that a lot of web service work is done in Go, so there is an abundance of tools available. That’s not the case for Julia. On the other hand, there’s a relative dearth of numerical packages available for Go. Also, Go syntax is not very amenable to numerical computing. Just the lack of automatic promotion from int to float makes for very messy code. Higher level data types (vectors, matrices, anything) require function call syntax for any operation, etc. Horses for courses, as they say.
A fine example of people asking questions with zero prior research.
Some Julia users use it for things related to web development, but primarily because this allows them to use their favorite language for something else.
Julia’s comparative advantage is not in web development, so if that is someone’s main application then something else may be a better choice.
We have created a few web applications based on the following stack:
Angular + Julia + PostgreSQL
These web apps have been in production for more than a year now and we are very happy with this choice.
The Julia middleware handles the web requests just fine. Note: we use the Mux.jl to make things easier with HTTP.jl. We also use PostgresORM.jl to make things easier when interacting with the database.
After years of building web applications that need to handle large amounts of data (including for some datascience application), Julia has come as a blessing. We used to combine Java Jee (for the web part) + RServe + R which was a big headache both for development and maintenance. When we searched for a better stack, we looked into Go and Python and finally chose Julia.