#dt - duck tape for your unix pipes
1 messages · Page 1 of 1 (latest)
Some questions from @sweet sonnet from #pet-languages
im a huge fan of concatenative langs and have written & rewritten all too many forths, and im really curious if you had any firsthand experience with them before dt?
Yes I'm definitely a fan. I actually built a whole integration for Factor into Amazon's internal build system to help me learn Amazon's thing. (Kinda Bazel/Buck/Blaze-ish, but much older) No one is using it of course, which was part of the reason I chose Factor, there's such a tiny chance that anyone would take my proof-of-concept and build something in production with it
dt is actually a rewrite and fork of a different concatenative language (For now called "Rail") that I don't quite know exactly what I'll do with it, but I have some ideas on how something concatenative could be useful as a compiler backend, and have been reading up on work by Anton Ertl to understand stack-based compiler optimizations... Probably have a few years to really understand and digest this stuff tho
I've also done lots of experimenting with Forth, although nothing for actual work (yet!) but I believe hacking and hobby work can be just as "real." I got a physical copy of "Thinking Forth" right on my desk, and have been following @warm grove and his Assembly Nights projects for a while. Maybe someday I'll do something like a JonesForth for
or was the idea more based on intuitions from day-to-day shell usage ("hey, this is really concatenative-y...") and then working backwards from there?
It's also this. I've been working deep in the bootstrapping layer of Amazon's code base for a few years, and it's a lot of shell to get things bootstrapped. Also I spent a lot of time automating my own work so I can get to much higher levels of productivity. That, and I've contributed to Linux distros and such, and also I'm a Linux geek, so the shell is my life.
I doubt I've found the "final form" of dt, but I think I've got a reasonable core that I can call 1.0 and I can build on for a while until I understand how other humans might use it too
dt - duck take for your unix pipes
PS I like keeping the name "duck tape" vs "duct tape" ambiguous; that is like half the discussion on the largest HN thread lol
dt - duck tape for your unix pipes
This is really nice! Just a quick note that some links in the doc 404's, like https://dt.plumbing/user-guide/lang/glossary.html#command
Thanks! I'll fix that, I've been kinda rushing on the docs. Let me know if anyone finds any others
I guess if something is not in the table of contents, mdbook will not render it
Yes I'm definitely a fan. I actually built a whole integration for Factor into Amazon's internal build system to help me learn Amazon's thing. (Kinda Bazel/Buck/Blaze-ish, but much older) No one is using it of course, which was part of the reason I chose Factor, there's such a tiny chance that anyone would take my proof-of-concept and build something in production with it
ooh sounds interesting, ill have toestalkinvestigate when ive got the bandwidth im curious, are custom build systems a Builder Tools rite of passage or just an extremely beneficial extracurricular? id been longing to join BT for ages but the powers that be dont seem to be very generous when it comes to headcount, especially since layoffs and austerity mode
dtis actually a rewrite and fork of a different concatenative language (For now called "Rail") that I don't quite know exactly what I'll do with it,
too relatable.dtactually being useful is something that really drew my attention. concat langs are just kinda... pointless in the real world, but fish and nushell have proven thatshcompatibility isnt necessary to be useful. do you actually daily drivedtyet?
Anton Ertl
just skimmed some of his papers. some seem kinda interesting. i found https://sci-hub.ru/https://doi.org/10.1002/cpe.1016 pretty neat. its basically "what if we did old school forth AOT compilation as a JIT?". not the best compiler by any means, but its a really simple approach to making a portable-ish JIT. every time i see stuff like this, it gets me brain going on evil hacky ways to optimize forth. i always keep ending up with "where can i sneakily un-forth this forth code?", but unless you heavily constrain the backend's stack-oriented intermediate representation (like you have: no variadics, etc), then theres just way too much observable behavior that optimizing well sounds hard/impossible. however.. if you do have those contraints along with quotation-based control flow, then i suppose that a stack representation is probably as expressive as single static assignment with phi nodes (what llvm uses).
Maybe someday I'll do something like a JonesForth for
i would highly recommend hacking up a basic forth in assembly if youve got a spare weekend. i had learned mips assembly in college, but forthing was how i taught myself x86. so much fun! brad rogriguez has a super informative series of article called Moving Forth that goes over the "magic" that other resources do a poor job of explaining (especiallyDOES>. holy cow that word takes a few attempts to really grok). as a nice side benefit, he uses older assembly languages different enough that its not just copy pasting like jonesforth is :) https://www.bradrodriguez.com/papers/index.html
It's also this. I've been working deep in the bootstrapping layer of Amazon's code base for a few years, and it's a lot of shell to get things bootstrapped. Also I spent a lot of time automating my own work so I can get to much higher levels of productivity. That, and I've contributed to Linux distros and such, and also I'm a Linux geek, so the shell is my life.
and that doesnt make you despise shell with a burning passion? youre a stronger man than i
speaking of bootstrapping, my new team has finally solved the problem: every package is aNoOpBuildand you just refer to thescripts/directory and an incorrectly documented list of system dependencies 🙃. oh, and dont forget the git submodules that point to codecommit repos, so you better have the git remote helper installed too 🙃. once i better understand our mono-ish repo build tooling, im on the first flight to Peru.
Are you an Amazonian too?
sengir@ :^)
I'm former-Amazon as of last Friday, was hiljusti@
i was the one asking about cflags during the brain dump
Oh right during the Zig meeting -- last week was a whirlwind of many things
same. last week was also my last week at my old role
id been longing to join BT for ages
I recommend it if only to grow skills. Holy moley does it push you to grow your skills. I've had multiple CRs in Amazon where more than 5 PEs were directly invested and commenting and etc. Especially these teams: SCCAM, Language Experience, Build Execution, with SCCAM being most challenging
talk to Robert Knight if you need a foot in the door for conversations
do you actually daily drive dt yet?
Not as a shell, but yes I've used it for non-trivial shell scripting kinda things. Last day of Amazon I used it to automate out patches to some Java 3p imports that had unused dependency resolutions
every time i see stuff like this, it gets me brain going on evil hacky ways to optimize forth.
I think the most promising idea on optimized Forth that I've seen so far is meow5. Basically: always aggressively inline compilation
once i hit L6 over in kuiper (or if kuiper is too nightmarish), that sounds like a plan. i know id been watching for open reqs for ages and it was as dry as a desert for L5s every time i checked. ill write his name down, thanks!
He's a real good manager. Next person I could refer to is Jesus Ruiz-Scougall -- he's the only director I know with a github account lol
I recommend it if only to grow skills. Holy moley does it push you to grow your skills. I've had multiple CRs in Amazon where more than 5 PEs were directly invested and commenting and etc. Especially these teams: SCCAM, Language Experience, Build Execution, with SCCAM being most challenging
i love estalking buildertools CRs and its great seeing all the high viz stuff. but i especially loved seeing PEs fighting the good fight for Peru by dirtying their hands with updating, fixing, migrating ancient packages that everyone was too afraid to touch for whatever reason
oh yeah
a lot of that still needs to happen
but hands-on PEs is the name of the game in BT
in a not-stepping-on-toes kind of way
I wish, though, that I had a chance to work on Kuiper too. Especially if I could have done some embedded stuff THAT WOULD GO TO SPACE lol
I live near leblstev@ and we get the occasion to talk every once in a while
thats basically what OG single pass forth compilers do, but the problem is that you really need additional passes to benefit from inlining. with modern branch prediction, branches can be basically free if you arent doing anything bone=headed, like jumping to a register offset. a lot of older forth implementation tutorials will misguide you to absolutely torturing your branch predictor with indirect threaded code ITC. thats another reason why i like brad's articles :)
neat! maybe not dogfooding but instead dogtreating?
something like that haha
It's dog-fooded in some other areas of dt like generating the stdlib html https://github.com/booniepepper/dt/blob/gh-pages/gen-docs.dt
i love it! elsewhere i usually either saw two kinds of PEs:
- the man with the plan--they sketch out a prototype implementation of a thoughtful solution to a really complicated problem, then that serves as a spec of sorts for others to actually implement it
- too busy barraged by middle management meetings, holding office hours, and forwarding emails to really do anything on their own
is that a 🪃 i see? haha
Maybe some day haha
on topics not pursuant to ITAR/EAR i hope :P
Very general stuff like the effects of cosmic radiation, or the state of proprietary software used to simulate satellites
i will admit, i think the org really needs some Builder Tools peeps who really know their shit and how to best amazon-ify this whole mess of codebase. ive heard that others teams have brazil deps, others have peru deps, and like i said we use git submodules. i have no clue if anyone actually uses build fleet. 😉
i was referred to someone working on fixing this mess, but theyre ooo for another week or two. really excited to see what the longterm plan is
yeah, its crazy. one of my interviewers mentioned how he had a prototype overnighted to him so he could take it to a local medical center to blast that mofo with enough radiation to simulate X months in space
Almost all organizations at Amazon eventually end up with some local BT equivalent. Some "Platform Reliability" or "Infrastructure" or "Release Engineering" team -- especially subsidiaries. They'll work with BT on their needs, and pick up the work that's too specialized to whatever they do
i really hope that once my team catches up on our launch-blocking (literally lol) backlog, we can evolve into that team. currently we're the Linux Embedded Platform team and not only define the runtime, but also provide SDKs to client teams
or maybe that team already exists, idk. this is my second day lmao
also, completely unrelated anecdote that i find friggin hilarious (read: terrifying): following the "how to build" guide for our codebase and just doing the default "brain=off" instructions for each step will have you wgeting a random executable from github into your dev-dsk's /usr/bin 🙃
uh, i mean i love concatenative languages. dt is really cool
yay concatenative languages!
BTW I would recommend casual users to wait until
- Zig releases at 0.11.0
- Your package manager of choice supports Zig 0.11.0
- dt is packaged for your package manager. (I will probably create packages at least for Nix, AUR, Void, FreeBSD, and Homebrew)
If anyone is using it seriously before that point, let me know what you're doing so I don't break you inadvertently
Before then I'm considering some features "stable" only after I've documented the intended behavior (and make sure the real behavior matches the intent!)
Some minor updates:
- Zig did release 0.11 and dt has been updated
- Packaged for Nix: https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/text/dt/default.nix
- Packaged for AUR: https://aur.archlinux.org/packages/dt
- Packaging blocked for Void (my personal daily-driver) on LLVM first and Zig 0.11 second: https://github.com/void-linux/void-packages/issues/45424
- Packaging for other Linux/BSD/Mac(/Windows?) not started
- Working on the memory model now
BTW I also created a discord server to talk about concatenative languages: https://discord.gg/AyNn8f2DAu
Show notes: https://zig.show/episodes/35/
0:00 Intro
3:25 Talk
44:15 Q&A
Phew that was fun! But I really needed to rehearse a demo more if I do this again
And dt is an interesting tool. Way back in the 80s I had fun with forth on Macs - even made a little money with it. The Forthish roots of dt are very evident. Nice addition to the toolkit.
I was trying dt out (nice project btw!), and i noticed that the gcd rosetta code example doesnt seem to work properly:
dt 1.3.1
Learn from my mistakes - someone should.
» [\x: [\y: x x y % gcd] x do?] \gcd def
» 15 24 gcd pl
9
»
[[a b]: a [b a b % gcd] b do?] \gcd def
not tested extensively but I think this works. I think the previous one only worked by accident on some cases
Nice, this seems to work properly! 👌
😮💨 phew
dogfooding project of the night:
I'm making a site generator for a personal blog