Open abhi18av opened 7 years ago
Generally we prefer implementing most things in the language rather than as command line flags. That way they're usable by applications that embed julia, and they can be toggled interactively in a repl or ijulia session, or for specific sections of code.
Oh, right)
Btw, you've made me curious - could you point me to an application where Julia has been successfully embedded?
That's a better question for discourse.julialang.org. node-julia is one public example that comes to mind.
@tknopp , yes I do know about the docs but I'm looking more along the lines of node-julia as @tkelman suggested - thanks.
So, correct me if I'm wrong. Julia is as embeddable as GnuGuile ?
The Julia standard library has way more dynamic-library dependencies than Guile (the majority of which are technically optional, but it isn't currently very easy to remove some of them). Otherwise I don't know if anyone here is familiar enough with Guile to meaningfully answer that question, and again it's better for discourse.
Oh, I see. Thanks @tkelman and @tknopp
I do really like Perl's command-line switches for this sort of thing and still regularly use them to write Perl one-liners (Ruby's were largely borrowed from Perl). We could have some macros that implement some of the functionality to allow one-liners and then provide a way to invoke julia
which makes those macros available. I'm imagining something like this:
julia -1 '@ple replace(_, r"[aeiou]+", "_")'
Here the -1
would stand for "one-liner", which would make the @ple
macro available (along with various other handy macros). I think we could leave this issue open for some discussion of what hooks and other work are necessary to make this practical. One of our major practical issues is that startup time, although much better than it once was, is still a bit long.
would be better to have a oneliner.jl entry point that does whatever setup and loading you need. you could alias that to a shorter name in your shell if you want. I'm skeptical any of this needs command line flags, we should be moving the ones we have like depwarn into the language instead.
The whole point of one-liners is that it should be a ready tool that you don't need to do very much to use – ideally, just a few characters. If we're going to do it that way, we need, at the very least a mechanism for concisely loading packages in specific like the proposed oneline.jl
. If we have to write this:
julia -e 'using OneLiner; @ple replace(_, r"[aeiou]+", "_")'
That's not the most verbose thing in the world, but it's enough a pain for one-liners that people won't use it – or at least I won't. At some point it will get embarrassing that I still write my one-liners in Perl.
There are packages that define command-line entry points. This doesn't need to be implemented in C here to have a convenient UI.
@StefanKarpinski I like where this is going - thanks for thinking "inside the quotes" 👍
Who said anything about implemented in C?
all of the command line argument parsing for the julia executable is in libjulia
And I changed the scope of the issue to being "provide some mechanism to support one-liners."
Hi @julia-lang team
I've been following the evolution of
julia
language for a while now and I am trying to incorporate it into my daily work-flow which does involve a lot of one liners lately. The one that I mostly use is the cloud basedjuliabox
So, my question is are there any plans to add the
ruby
like command line flags as listed below. I know that this might be a low-priority thing but still, julia has a tendency to spoil the user for wanting more :+1: