TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: If you were designing Common Lisp today, what would you change?

18 点作者 Decabytes超过 2 年前

8 条评论

pfdietz超过 2 年前
Leave less undefined in the specification. In particular, there should be more defined cases for errors in safe code.<p>Complex type upgrading is just broken. The spec is inconsistent.<p>sort should have been called nsort, to be consistent with the names of other potentially side-effecting operations. SORT would not alter its argument.<p>If defpackage has no :use clause, it would be equivalent to (:use), not implementation-defined. Also: make package local nicknames part of the standard.<p>Many built ins functions should be generic and allow user defined methods if at least one argument is not of a standard-defined class. This should not have an efficiency penalty.<p>Many built-in classes should be user extensible, or at least have internal generic functions that can be extended. The exemplar here is user defined sequences in SBCL. This would also be useful for hash tables and streams.<p>Pathnames tried to be general and failed. They need a revamp.<p>Add support for multiple threads, concurrency, unicode.<p>Although it saddens me to say it, get rid of the punning of NIL and false, and make CAR&#x2F;CDR not work on NIL.<p>Although it&#x27;s not part of the standard, have a more robust social mechanism for curating and maintaining a semi-standard library, just outside the standard.<p>Packages should allow weakness, so that if a weak symbol is not used anywhere it can be GCed from the package. This could help with tree shaking.
评论 #34299099 未加载
评论 #34299096 未加载
anlsh超过 2 年前
Some sort of governing entity. The ANSI standard has left the language totally dead in the water, and is the single biggest thing holding back this really quite beautiful language<p>Package local nicknames. The situation that libraries like Alexandria are in is really sad.<p>Nested namespacing&#x2F;packages.<p>The ability to alias imports, like in Python.<p>In the same vein, most symbols in the spec should be moved into a standard library.<p>A general equality predicate which can be specialized by the user.<p>Just replace multiple-value-returns with structs, they don&#x27;t add anything useful.<p>Standardize some variant of arrow macros.<p>Every form which introduces a binding should be able to take a (optional) type specifier. It&#x27;d be great if compilers could use this option to remove generic dispatch in certain compilation modes.
评论 #34243685 未加载
评论 #34302551 未加载
评论 #34242248 未加载
daly超过 2 年前
NIL punning should remain. Otherwise there needs to be some NIL-equivalent value or some exception nonsense.
评论 #34255271 未加载
sargstuff超过 2 年前
Using &quot;box of punch cards&quot; as REPL, &quot;punch card machine&quot; as &#x27;solo cpu&#x27; and &quot;device operator&quot; as handler for everything else. Lisp just does the punch card box. Scheme does &quot;the box&quot; with access to the &quot;punch card machine&quot; and emacs covers the whole REPL, &#x27;solo cpu&#x27;, &#x27;device operator&#x27; stuff<p>So, common lisp needs a &#x27;device operator&#x27; namespace.
sargstuff超过 2 年前
Rename Lisp to Heap-p, Polyp, Matrixp, or Affinep
sargstuff超过 2 年前
namespaces tied to an abstraction level.<p>multi-threads, concurrency would be a process namespace &amp; standard command &#x2F; data name spaces could be mapped by programmer to how wanted to use in process name space.<p>error(s) would be done in a &#x27;error&#x27; namespace.
qualudeheart超过 2 年前
Systems programming language in the style of Chez.
评论 #34244330 未加载
kazinator超过 2 年前
I developed a language called TXR Lisp, which has ties with Common Lisp in many areas. If you look at the reference manual, which is conveniently one giant manual page available in HTML form, there are numerous dialect notes that mention ANSI Common Lisp; a chunk of that would likely be things I might change in Common Lisp.<p>Some things I would fix without changing Common Lisp:<p>* redefine &quot;binding&quot; as being an association between a symbol and a location.<p>* I&#x27;d make (setq x y) have a predictable, documented effect when x is not a defined variable. It would cause <i>x</i> to be bound to its value cell, and place the value of <i>y</i> into that cell, and that would be the same as (setf (symbol-value &#x27;x) y).<p>* pick up some outstanding issues and resolve them, like this one: during a dynamic control transfer, an exit point is identified for that control transfer and then unwinding takes place. It is not specified in CL whether the intermediate exit points (the ones not selected for the transfer which are being skipped) are torn down before the control transfer takes place, or torn down as-you-go during unwinding. I&#x27;d fix that as being tear-down-as-you-go. This affects situations when an unwind-protect intercepts a control transfer and then tries to initiate a new one to a different exit point.<p>* I&#x27;d fix the order of evaluation of a function binding relative to the arguments. We know that in (f x y z), the x y z are evaluated in left to right order, if f is a function. However, we don&#x27;t know whether the f binding is resolved before or after the arguments. I&#x27;d pick one order and require it; probably before the arguments, though that requires the longest possible temporary storage. Obviously there are situations in which the binding isn&#x27;t evaluated each time the function is called, like when it has been inlined.<p>* loop would support application-defined clauses.<p>* structs and CLOS would be integrated together; conditions would be CLOS instances.<p>* in the area of pathnames, I would have the language specify precisely how POSIX and Windows paths correspond to pathname objects. Every implementation would have to follow that. For instance, it couldn&#x27;t be that one implementation sees &quot;foo.c&quot; has having a type &quot;c&quot;, and another one doesn&#x27;t. Everything would be specified down to what happens with double slashes, and trailing slashes.<p>* string literals would support escape sequences for special characters. Also, Unicode would be required. Implementations would have to support UTF-8 code.<p>* string literals would support a way of splitting across multiple lines, such that the reader eats the leading indentation. Thus, the <i>format</i> function wouldn&#x27;t need a hack for this.<p>* FFI would be in the language.
评论 #34321698 未加载
评论 #34298907 未加载