编程与软件工程scottlocklin.wordpress.com
审视 J 语言:天才与疯狂之间的细线
A look at the J language: the fine line between genius and insanity (2012)
2012 — 2020,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是 Scott Locklin 2012 年写的一篇博客,讨论 J 语言——APL 的后裔、由 Ken Iverson 与 Roger Hui 设计的数组编程语言。文章围绕它极度紧凑、符号化的写法展开,探讨这种设计究竟处在天才与疯狂之间的哪一侧。
为什么经久不衰:它每隔几年就会被重新发现一次:J 这类 APL 系语言的信息密度和数组思维至今仍是异类,在硬件越来越像数组的今天反而更有参考价值。
HN 评论精选
作者多年后用 J 做量化基金,认为数组式硬件让 J 更合时宜,并推荐 jd 数据库和 Shakti。
那个 TSDB 现在叫 jd。有意思的是,我从那时起断断续续用 J,到现在仍不确定它是天才还是疯狂。它和其他 APL 一样自成一体,就像 Lisp 一样(我之前最喜欢的怪语言是 LeCun 和 Bottou 的 Lush,我仍觉得那是个了不起的设计)。稍微熟练之后,你会终于意识到什么才叫真正的高层语言。我认为它在某些方面正逢其时:硬件比以往任何时候都更像数组。J 从 806 到现在 902 beta 演化了很多,摆脱单核范式带来了大量性能提升。还有不少可挖掘的地方,也有一些有趣的 J 创业公司在酝酿。我还认为它是我所知道最好的用户社区之一。对了,还应提一下 Art 的新语言 Shakti,很多人为之兴奋。
scottlocklin查看英文原文
The TSDB is now called 'jd'[0] FWIIW. Funny, I've been using J on and off since then and I'm still not sure if it's genius or insane. It, along with the other APLs, is definitely its own thing, just as much as Lisp is (my previous favorite weird language was Yann LeCun and Leon Bottou's "Lush,"[1] which I continue to think is an amazing design). Once you get a little bit proficient at it, you finally realize what an actually high level programming language could be. I think it's an idea whose time has come in some ways: hardware is more array-like than ever. J has evolved a lot from 806 to the present 902 beta; lots of performance increases from moving away from the single core paradigm (where it excelled anyway). Lots more to unlock there as well, and some interesting J-based startups brewing[2]. I also think it's one of the best user communities I know of. Oh yeah, Art's new language Shakti[3] should probably be mentioned. Lots of people excited about this. [0]https://code.jsoftware.com/wiki/Jd/Overview [1]http://lush.sourceforge.net/ [2] https://www.monument.ai/ for example [3] https://shakti.com/
APL 系语言值得认真学,KDB+/Q 在金融界报酬极高;J 与 K 的创造者师出同门。
程序员们在一遍又一遍地重新发现 APL 和面向数组的编程。如果有人真的认真对待数组编程/APL 并想以此谋一份高薪职业,那就去学 KDB+/Q/K,它们有一个小而活跃的社区。讲个轶事:我曾是金融界相当活跃的 KDB+ 程序员,但大约 8 年前离开了金融和编程。就在昨天,一位正在做加密货币统计套利基金的朋友发邮件给我,他们打算用 KDB+,开价“30 万到 50 万美元底薪加激励”请我……显然我朋友不知道我现在做的是销售和市场。顺带一提:J 的创造者 Roger Hui 与 K/Q 的创造者、KX 创始人 Arthur Whitney 是编程上的同门。
ktamura查看英文原文
Programmers continue to discover and re-discover APL and array-oriented programming. If someone is serious about array programming/APL and wants to make a lucrative career in it, study KDB+/Q/K. There's a small but active community around them. Just to relate an anecdote: I used to be a fairly active KDB+ programmer in finance but left both finance and programming ~8 years ago. Just yesterday, I got an email from my friend who's building a statarb fund around cryptocurrencies. They were going to use KDB+ and offered me a job for "300-500k base with incentives"... My friends clearly don't know that I now work in sales & marketing :D Aside: Roger Hui, the creator of J, is a programming sibling of Arthur Whitney, the creator of K/Q and the founder of www.kx.com
一位爱好者展示用 kdb+/q 抓取并阅读 HN 的完整小工具链,并反问在 J 中该如何实现。
这是我用来读 HN 的 .q 文件。我是业余程序员,欢迎指正改进。更好的是:这在 J 里该怎么做?(代码略)至于 hn.csv 怎么来,我用 shell 脚本按 robots.txt 规定的延迟下载 HN 的所有页面,再用 flex 写的一个简单词法分析器把 HTML 转成含上述列的 hn.csv。几年后 hn.csv 会大到超过可用内存。读取和选取文章我用 less(1) 加一些小 shell 脚本:列出某偏移之后的所有文章标题,管道给 q 再交给 less;然后用 less 的 “:!cmd” 功能调用脚本来读正文或评论,退出后回到 less。见过很多 HN 读者做的阅读系统,这是我的,用 kdb+。
aplorbust查看英文原文
Heres the .q file I use to read HN. Hobbyist programmer; corrections/improvements welcome. Better yet, how would I do this in J? cat 1.q \c 2000 200 k)-23!t:select from .:`:t.kdb k).Q.fs[{`t insert +:`url`title`user`item!("SSSS";",")0:x }] `:hn.csv k)-23!t:?:select from t `:t.kdb set t \\ As for how to get hn.csv, I use shell scripts to download all the pages of HN html (in accordance with robots.txt specified delay). Then I use a simple lexer (made with flex) to transform the html to hn.csv with the above selected columns. After some years, the file hn.csv can grow quite large, larger than available memory. To read and select articles from t.kdb, I use less(1) and some small shell scripts. This lists all the articles, starting after a given offset, or zero by default: echo -e '\\c 2000 2000\nk)select i,title from .:`:t.kdb where i>'${1-0}'\n' \ |exec q > 1; exec less 1; Then, to select and read an article or its comments I use the ":!cmd" feature in less(1) to invoke an appropriate shell script (actually, an execline script). Quit, and I am returned to less. Have seen lots of systems for reading HN made by HN readers, using various databases I guess. This is mine, using kdb+.
学过众多语言的老手认为 J 既令人望而生畏又极具吸引力,代表一种极致的信息密度美学。
我学过不少语言,但 J(以及它的同族 APL 和 K)既是我觉得自己没耐心学下去的语言,也是我觉得一旦真学会可能会爱上的语言。那些看不懂的程序似乎暗示存在某种“最大信息密度”——每一次击键都带来最大生产力。盯着一个程序,故意改动一个字符就产生天壤之别,这在艺术上很吸引人……不过另一方面也挺吓人。这个视频很好地展示了这种范式的威力。我学过的语言大致按顺序是 C、Java、Lua、C#、Ruby、Python、Lisp、Forth、Prolog、Clojure、OCaml、Haskell、Erlang、F#、R、Racket、Rust,也看过 ATS、Cyclone、C++、Idris、Agda、D、Perl 6。在所有这些人里,APL/J/K 确实是最奇特的一类。
Verdex查看英文原文
I've learned a bunch of different languages[1], but J (and its friends APL and K) has been both the one that I don't feel I have the patience to learn AND the one that I feel like I might fall in love with if I actually learned it. The incomprehensible programs just seem to hint that there is some sort of maximal information density where every keystroke provides maximal productivity. There's also something artistically appealing about starting at a program and making a deliberate one character change that makes all the difference ... although on the other hand, that's kind of scary too. Here's a video that really illustrates the power of this paradigm: https://www.youtube.com/watch?v=a9xAKttWgP4 [1] - I learned (in this approximate order): C, Java, Lua, C#, Ruby, Python, Lisp, Forth, Prolog, Clojure, OCaml, Haskell, Erlang, F#, R, Racket, and Rust. I also took a look at languages like: ATS, Cyclone, C++, Idris, Agda, D, and Perl 6. Of all those languages it really feels like APL/J/K are the strange ones.
历次讨论
同类还值得读
开源应用架构
The Architecture of Open Source Applications
《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。
编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选编程语言简史:简短、不完整且多半错误
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。
编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.comSQLite 是如何测试的
How SQLite is tested
SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…
编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选高级编程语言(2009)
Advanced programming languages (2009)
Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…
编程与软件工程上首页 8 次 · 2009–2022matt.might.net我的 Forth 与栈机器经历
Yosefk - My history with Forth & stack machines
作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。
编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选