9 ms·
J for C Programmers
- avmich 6y agoThe whole book is pretty good. After reading and applying the earned knowledge one wishes the book would be longer, with more material covered, but there are other books on J, essays and phrases on jsoftware.com, articles and forums - especially forums. This book is quite suitable as a first book on the subject. It's a good reference, too, for basic mechanics; for style in organizing longer thoughts one would go besides the book. There easily could be a few "aha" moments while reading. One could be in the discussion on verb ranks - then the words at the beginning, about the general commanding the army as a whole, becomes clearer. Another is a classification of loops - an unusual viewpoint for traditional C approach.
- ggrrhh_ta 6y agoI read it putting all of myself into it (even caught a couple of typos/bugs). I also read Iverson's. These languages (APL, J, K) promote a programming paradigm that sits somewhere in between the continuous spectrum between imperative and functional paradigms. There is lot of good to absorb from J, and not little of it has fortunately permeated into the famous Python's numpy library. Many people have been inadvertently using APL/J deepest concepts thanks to it. I do think that, even if they are beautiful, they are still generations away from a community Zeitgeist that would render as widely spread as, for example, Haskell.
- Tomte 6y agoCan someone who knows all those one letter languages well succinctly describe the differences between J, K, Q and APL? What I think I've got so far (this is all hearsay, and none should be taken as fact): APL: The original. Non-ASCII. APLers hate the successors, because "notation is tool for thought" and ASCII is a poor representation. Main implementations GNU APL (slowish), Dyalog (fast and expensive, free version available, good documentation) K: ASCII, used in finance (among other sibling languages, dependent on the concrete company and concrete group within a company), comes with kdb+ (columnar data store, integrated with K), very fast (main interpreter loop in processor cache), one real implementation (very very expensive, limited free version available), several cvariations on the language, some of them open source, none comparable Q: syntax sugar upon K, but otherwise exactly the same J: another evolutionary strang of APL, impeccable pedigree (Iverson), free software, experiments more with language features, is more complete when it comes to the "linguistic" style (adverbs etc.), database available (Jd, but this database is commercial), slower than K, more extensions like for GUI programming
- SifJar 6y agoOn K - there are now two "real" implementations, one by Kx Systems (i.e. the version under the hood of kdb+) and one by Shakti (new company from Arthur Whitney, original author of k). The Kx one is k4, Shakti is k9. Having said that, k9 is still quite a "work in progress", don't think it's considered production ready yet. May also be worth nothing that k4 is essentially "undocumented" and Kx encourage to use q instead of writing any code in k directly. Most functionality can be pieced together using docs from other versions of k (I think k2 manual is floating around online) & the docs from q.
- felixr 6y agoI thought Shakti started at k7, and k5 and k6 have also a Kx implementation. BTW, https://ngn.bitbucket.io/k.html https://ngn.bitbucket.io/k.html is a great overview of K implementations and which version they are implementing. edit: k5, k6, k8 were apparently never released (https://aplwiki.com/wiki/K https://aplwiki.com/wiki/K)
- SifJar 6y agoYep, for a while Shakti was k7, but then Arthur started over & it became k9. Not sure what happened with k8 k5 was also known as "kOS" and was to be a version of k as a full OS that could run directly on hardware - I believe that got abandoned due to the pain of writing drivers http://archive.vector.org.uk/art10501320 http://archive.vector.org.uk/art10501320 - article about kOS before it was abandoned
- bambataa 6y agoHow does q relate to K? I dabbled a little but the distinction was never clear to me.
- rscho 6y agoQ is K syntactic sugar to make the system easier and more "traditional".
- 6y ago
- mastrsushi 6y agoI prefered the sequel K for D programmers.
- giancarlostoro 6y agoFunny though anything that competes with D better be damn good. The more I study and write small projects with D the more I love about D!
- DoingIsLearning 6y agoSame! The more I think about what we do in Software the more I value readability. I think one of the reasons I love D is that it clearly treats readability as a design requirement. I just wish there were more jobs out there using Dlang...
- lmm 6y agoWhat does D offer over OCaml or any other ML-family language? I never really got what its selling point was at the time - "compile-time reflection" sounds like the worst of both worlds (but I guess it means something akin to typeclass derivation?), and the idea that it could kinda-sorta work without GC was never really explained clearly enough.
- voldacar 6y agoD shouldn't really be compared to ML. D is really just a reimagined C++, free of a lot of C++'s absurdity and incoherence
- lmm 6y agoBut I'm not looking for "a reimagined C++". I'm looking for "a programming language". What is the question for which "a reimagined C++" is the answer? (Maybe a language for use in environments where GC is not acceptable, but D fails to make a convincing case that it is such a language).
- moron4hire 6y agoIn the section on "Culture Shock": https://www.jsoftware.com/help/jforc/culture_shock.htm https://www.jsoftware.com/help/jforc/culture_shock.htm The triple quotes are ugly. Quit bellyaching... I love it. So many arguments in PLT are really just about not ever wanting to leave ones comfort zone. Sometimes you just have to suck it up and do a thing.
- goto11 6y agoI would like to read such a culture shock section for every language I don't know yet! I like that it doesn't evangelize and it doesn't disparage C, it just explains the logic behind the differences.
- scottlocklin 6y agoOne thing to be careful of; J has evolved quite a bit between j805 and j902[1]. While JforC is usually fairly simple examples, I don't think anyone has done the work to bring it up to date (in fact it's probably j5 vintage). Might also be true of the dictionary and some of the phrases. Nuvoc is the bleeding edge language reference. [2] Great book though; it's how I learned, more or less, along with the "labs." [1] https://code.jsoftware.com/wiki/System/ReleaseNotes https://code.jsoftware.com/wiki/System/ReleaseNotes [2] https://code.jsoftware.com/wiki/NuVoc https://code.jsoftware.com/wiki/NuVoc
- michaelcampbell 6y agoAPL-likes have been a fascination of mine for some years, but sadly at a distance. For those of you working in these languages, what do you use them /for/? What industries and/or kinds of applications do you write? Why are these languages used for them vs others? I'm looking for some inspiration. (I think) I'd love to use one "for real"/"in anger" for something but are they too niche to use as CV/Resume enhancement?
- tom-thistime 6y agoI'm afraid this isn't a particularly good answer. Anyway I use Matlab, which I think shares some ideas with the APL-like languages. (Coders who already know they hate Matlab can skip to the paragraph labelled "Downside" below.) What's good about Matlab? Maybe the best comparison I've seen in a normal language would be LINQ in C#. If you've been writing (or reading) code that makes heavy use of LINQ, imagine re-implementing all that stuff using explicit loops with dummy indices and all the rest of that line noise. Yuck. Hard to write and worst of all hard to read. Matlab takes that further than LINQ does ... in certain directions. Basically stuff with arrays. I don't know whether the APL-likes take the same idea even further than Matlab, or just use short keywords. Downside: when your problem doesn't break down into array patterns that Matlab is good at, then Matlab stops being fun. At all. For stuff like that, where you really do need to supervise every line of C-ish code personally, something like Ruby or C# is way more fun. (Except if you're doing say EE or optical physics. Then Matlab's libraries are still a huge time saver.)
- gaze 6y agoI took some time and used APL to write a little query DSL for answering questions about a legacy C++ codebase. I had a collection of little tools that linked against clang and dumped out XML files containing various cuts of information of the codebase. I then borrowed some techniques form Aaron Hsu to do structural queries that joined these tables together in ways that gave me useful information about the codebase. It was alright. I don't think I was able to invest enough in APL to make it really stick but have the impression that if I did it could be very useful. Fwiw, Aaron Hsu is really the guy to follow for all things APL. He's also super nice and helpful and a model for anyone who wishes to represent a technology.
- woodrowbarlow 6y agoi'm a C programmer, not for any great love of the syntax, but because i cross-compile for embedded hardware with limited resources and there aren't a lot of options. there are also other use cases for C. since it is close to the metal, it is a good fit for security-sensitive, heavily-audited codebases, because there are fewer layers of abstraction to audit and a smaller attack surface. manual memory management makes it a good fit for performance-sensitive applications, real-time encoding, signal processing, etc., because a garbage collector isn't competing for CPU time. there's a lot of overlap between all these use-cases, though, and most of it comes down to the fact that C: * is compiled, * has manual memory management, * is a relatively small language with a relatively small standard library, * (and of course, we can't ignore the network effect) is ubiquitous. so, when i see a document to introduce me to a new language, and it claims to be written for C developers, the first thing i am going to look for is some information about the language so that i can judge whether it is even remotely suitable for the contexts in which i would normally write in C. i read "foreword", "introduction", "culture shock", and "running a j program", looking to answer some questions like: is it compiled or interpreted? if interpreted, how complex is the interpreter? if compiled, does the compiler use LLVM or some other intermediate AST? is it garbage collected? can the garbage collector be turned off? how does performance compare? the only passage that tried to answer "why should i bother?" is a couple of sentences in the foreword: > To begin with, for the productivity. J programs are usually a fifth to a tenth as long as corresponding C programs, and along with that economy of expression comes coding speed. Next, for the programming environment: J is an interpreted language, so your programs will never crash, you can modify code while it's running, you don't have to deal with makefiles and linking, and you can test your code simply by entering it at the keyboard and seeing what it does. all of that is true of python too, but that doesn't mean python can do what i do with C.
- yiyus 6y agoI think you are misunderstanding the intention of the book. When you see a book titled "Japanese for English speakers", what it means is that it builds on your knowledge of English to teach you Japanese, not that its goal is that you replace your usage of English with Japanese. Certainly, the book will not include a justification of how you can use Japanese to speak in London and New York as you can do with English, and probably it won't even bother explaining you why learning Japanese may be a good idea. And, yes, you probably could learn Chinese instead, but that is not the point.