7 ms·
Tex – Use Elixir like a scripting language, across your system
- thesuperbigfrog 6y agoVery nice! However, I would recommend a different name to prevent confusion with Donald Knuth's TeX: https://en.wikipedia.org/wiki/TeX https://en.wikipedia.org/wiki/TeX
- nextaccountic 6y agoIt was just renamed to Teex: > FYI: This was renamed from "Tex" to avoid confusion with TeX -- This project is now called Teex! The GIFs below might still mention tex -- just replace that in your commands with teex @dang can you rename the title of this submission as well?
- kelsolaar 6y agoNot only that but the executable file is called tex which would break when you have a LaTeX distribution on your system: Kali:~ kelsolaar$ tex This is TeX, Version 3.14159265 (TeX Live 2019) (preloaded format=tex) **^C
- ellisv 6y agoIt’s been a long time since I’ve used it but breaking my TeX is a non-starter for me
- dboreham 6y agoFinally a use case for Unicode filenames.
- generalizations 6y agoGood luck typing it into your terminal.
- boogies 6y agoThat’s what X’s Compose key is for (`setxkbmap -option compose:sclk && xcape -e 'Shift_L=Multi_key'`; tap Left Shift, e, e → ə; Left Shift, x, x → ×).
- generalizations 6y agoI mean, sure, there's plenty of ways to get the intended character/glyph into the terminal; but I really hope that we don't start doing that regularly as is implied above.
- ezoe 6y agoAs a Japanese, I type it with IME in any day.
- mikl 6y agoYeah, this was my first thought too, name is bound to cause problems and confusion. Very cool idea, though.
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- ganafagol 6y agoFrom the page: > FYI: This was renamed from "Tex" to avoid confusion with TeX -- This project is now called Teex! Maybe adjust the HN title?
- hprotagonist 6y agoneat tool, godawful name. it’d break most of my pdf making tool chain if it was permitted to come first in my PATH.
- owyn 6y agoSo how about "exit" as in Elixer It :)
- clankyclanker 6y agoThat’s still better.
- wwweston 6y agoIf it were me, I would not be able to pass the opportunity to use the most meta extension ever: .ext
- rbonvall 6y agoWorst name since "cat", my command-line tool for creating cat memes :o)
- enriquto 6y agoPlease, tell me more!
- doawoo 6y agoHey there! Author here. Good point! The name I was never super locked in on. Considering new ones for sure!
- hprotagonist 6y agocheers! i look forward to giving it a spin, then.
- Jarwain 6y agoCould call it "eli" for elixir line interface :D It does conflict with an APL derivative, but it appears hardly used
- andy_ppp 6y agoThere is a huge problem with this sadly, the startup time of the BEAM is too much! I was thinking about having a running VM process and injecting code directly, but I think this could be quite insecure. Love the idea though.
- doawoo 6y agoTotally understandable concern, in my quick experiments I haven't been bothered too much by the bootup time. But there's definitely better performance aware solutions for scripting
- andy_ppp 6y agoWhat is the startup time compared to bash?
- sususu 6y agoI haven't test, but IIRC, Jose Valim in an interview commented that the BEAM startup time is about 300 to 500 milliseconds
- GlennS 6y agoPowershell suffers from this same problem, and I find it very annoying. Really recommend you speed this up if it's possible.
- bostonvaulter2 6y agoBut would that be more insecure than running arbitrary scripts on your machine? I imagine you could build something akin to Ruby's spring for elixir, might be interesting.
- elcritch 6y agoYou could spawn independent actors for each invocation. That provide a degree of separation and be fine for secuirty, if the beam process was run as your user pid. Handling multiple stdin/stdouts would take some work, but doable with standard erlang libraries.
- 29athrowaway 6y agoThere is already TeX, the typesetting system. https://en.wikipedia.org/wiki/TeX https://en.wikipedia.org/wiki/TeX
- michaelpb 6y agoLooks cool, but as others said you need to change the name. TeX is a fairly well known language + tool that beat you to that name!
- bigbassroller 6y agoElixir’s ability’s to be used as a scripting language due to compile time has been one of its few weakness IMO against other languages such as Python and Go. Will be interesting to see if this changes the game.
- bigbassroller 6y agoAs far as the name goes, how about adding an extra ‘e’ to have it spelled Teex? Indpired by .eex file extension.
- doawoo 6y agoHey all! Thanks for all the enthusiasm for this little hacky tool. I'll be working on renaming the cli tool to 'teex' soon to avoid conflicts with TeX.
- fake-name 6y agoI wanna say, compared to a lot of the name conflict drama I've seen in the past, this was handled gracefully and with aplomb. A+
- codezero 6y agoMaybe don't sweat it. I keep a bookmark folder with all the threads on HN where the primary form of comment is complaining about the name. It's a pastime here, and it's a great way to provide a low effort comment that the community will upvote. In reality people don't google search for the name of a tool they already know, and if folks are looking for a scripting language for their system, they'll find it via Google, not some already-known-to-nerds name. That said, tex is short, and overlaps with a lot of stuff not even nerdy, so teex will probably help set you apart until the fanboys of some other obscure project called teex come to the party :)
- doawoo 6y agoI don't mind renaming it. It didn't cross my mind initially that it would be a problem. I want developers to have quick and frictionless tools when trying to hack out ideas. That was the main idea behind Teex anyways! If it makes someone's life easier, I've happily ctrl-f'd my code, retired the old Hex package, and published the new one.
- vcxy 6y agoI think you're not realizing how ubiquitous TeX, and the executable `tex` are. It seems like a bad idea to overlap with something so commonly already installed.
- codezero 6y agoWow yeah you really got me there. Let me check my geek credentials, nope, don’t have any, guess I wasn’t working for Red Hat in 1999. Dang, gee, gosh, you got me kid. I’ve worked in tech 25 years, worked in academia and published research in peer reviewed journals. I’ve never used tex in anger, and I know anyone who could, could also figure out how to run two binaries with the same name in their environment. Please, abandon your misdirected dogma, and do some fucking work.
- QuinnWilton 6y agoI love this, and I'm excited that you've finally released it! One of the biggest issues I run into with using Elixir as a scripting language is the difficulty of making use of libraries in a REPL without first installing them into a Mix project. Sometimes I really just want to open up a shell that has access to my HTTP client + JSON parsing library of choice, and until now, my workaround has been using a Mix project that I toss everything into. I'm very excited to dive through the code and see how you've implemented everything!
- lkuty 6y agoThat's cool, thanks. I always create dummy projects to be able to quick test a library or develop a few lines of code in the REPL and wished I could test them without doing a "mix new". Even better than that is the ability to script with libraries.
- etxm 6y agoIt’s already been renamed Teex. Chill. Otherwise this is awesome. Ruby and python have been my goto for years. Excited to have elixir as an option.
- methyl 6y agoThat’s awesome! The only other painpoint of using Elixir for ad-hoc script is terrible IEX experience. Canceling a line that you made mistake in is nearly impossible without loosing the whole existing context, pasting multiline pipelines is a no-go. I hope that iex on par with irb will become reality someday.
- deleted 6y ago[deleted]
- nickjj 6y agoDoes this get around the issue of the BEAM taking a while to spin up? One nice thing about Python and Bash is for the most part when you run a script you can see the output almost instantly. With Elixir, typically you end up having to wait half a second or longer while the VM boots up. It makes a very noticeable difference in practice.
- simongray 6y ago> Does this get around the issue of the BEAM taking a while to spin up? I'd be interested in hearing the answer too. One of the things that has held back Clojure's adoption as a general-purpose CLI scripting language has been the cost of JVM + Clojure bootstrapping. It's not long in the grand scheme of things, but 1 second matters a lot when chaining commands in the shell. There is now a CLI scripting version of Clojure that gets around this issue by running Clojure (and some bundled libraries) as native code through Graalvm native-image: https://github.com/borkdude/babashka https://github.com/borkdude/babashka