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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Designing and evaluating programming languages: Dagstuhl trip report

79 点作者 mnmlsm大约 7 年前

7 条评论

augustk大约 7 年前
Niklaus Wirth&#x27;s &quot;Good Ideas, Through the Looking Glass&quot; is an interesting read on language design (I started reading from section 4):<p><a href="https:&#x2F;&#x2F;pdfs.semanticscholar.org&#x2F;10bd&#x2F;dc49b85196aaa6715dd46843d9dcffa38358.pdf" rel="nofollow">https:&#x2F;&#x2F;pdfs.semanticscholar.org&#x2F;10bd&#x2F;dc49b85196aaa6715dd468...</a><p>&quot;Actually, a language is not so much characterized by what it allows to program, but more so by what it prevents from being expressed. Quoting the late E. W. Dijkstra, the programmer’s most difficult, daily task is to not mess things up. It seems to me that the first and noble duty of a language is to help in this eternal struggle.&quot;
评论 #16430222 未加载
评论 #16434263 未加载
评论 #16430308 未加载
pmontra大约 7 年前
&gt; Language designers often make vague arguments about the “simplicity” or “intuitiveness” of language features, without ever saying what they mean by these terms, or testing whether these claims are true.<p>Anecdotally the designer of Ruby, if in doubt, asked his little daughter what looked simpler &#x2F; easier to understand.<p>The post skimmed by the issue of polyglot programmers. I used to work with C, Java and Perl, now with Ruby, Python, Elixir, JavaScript. There is also PHP, which I made some money with but I never really cared much about.<p>What happens when working with so many languages in maybe as many different projects is that the amount of context switches increases. It&#x27;s like going back to a project after six months but it happens the next week. This makes it easier to spot both the weaknesses in my code (why did I call that variable so?) and the weaknesses in the programming languages (why did they do that when everybody else is doing that other thing which is so better?)<p>I could give examples and make everybody angry because every language has its share of problems :-)<p>A side effect is that I tend to write simpler and dumber code, because I have to understand it when I come back. The clever features of languages are tempting but I use them only for those special cases when everything else wouldn&#x27;t do. There are (un)surprisingly very few of them.
评论 #16432536 未加载
tincholio大约 7 年前
A bit unrelated, but to all CS people who may get a chance to go to Dagstuhl, do yourselves a favor and go! It&#x27;s, by far, the best environment I&#x27;ve ever encountered to discuss science with top-level (and also younger) researchers. The place itself is amazing, and the format of the seminars too. Also, you never know who you might meet there (I got lucky the last time I was there, and ended up having breakfast with Tony Hoare).
jtolmar大约 7 年前
&gt; Consider indefinite loops, which require someone to reason about potentially infinite executions of a block of code.<p>What if we didn&#x27;t have them? I&#x27;ve been thinking about making a language that&#x27;s primitive recursive, and not actually Turing complete. This doesn&#x27;t even have to look particularly alien: all the looping constructs are for-range and for-each style, recursion (cycles in the function call graph) is a compiler error, and otherwise it can be a typical programming language. The majority of code can be ported to this world just fine.<p>Graph searches don&#x27;t naturally look like for-each loops, but they do iterate over each element in a domain at most once. We can add a for-search loop which iterates over a domain in an order that&#x27;s determined mid-loop (looks like a for-each loop plus a queue command, the compiler generates the visited set and queue&#x2F;stack&#x2F;priority queue). That can be used (a little awkwardly) to do binary search as well, which is the main place people actually use recursion. (I think this is worth stealing, btw.)<p>Some programs like games and web servers are built around an intentional infinite loop. Having more than one infinite loop on the same thread sounds like an error, so let&#x27;s say there&#x27;s an actual infinite loop construct, and only the main method is allowed to use it. This plus generator functions allow dealing with input streams (though somewhat awkwardly). (This makes the language as a whole Turing complete, but most of the code is still not.)
qwerty456127大约 7 年前
&gt; We have no theory of language error-proneness<p>Language error-proneness is directly proportional to the rate of usage of mutability and side effects. Immutable references to immutable objects don&#x27;t quirk and pure functions always do exactly the same thing (usually exactly what you expect them to do).<p>The first time I have tried Scala (having no prior functional programming experience) I was mesmerised with how well it worked: every successful build would result in a program doing exactly what it was supposed to do (run-time quirks or errors were extremely rare) and whenever a build failed it was usually rather easy to find and fix the failure reason.
评论 #16436820 未加载
评论 #16430382 未加载
评论 #16430305 未加载
bringtheaction大约 7 年前
&gt; One can also reduce the formality of language abstractions, which may<p>If the author is here, I’d like to inform you that the above quoted text stopped mid-sentence.
Xophmeister大约 7 年前
If the author is here, this paragraph just ends on an unfinished thought:<p><pre><code> ...One can also reduce the formality of language abstractions, which may</code></pre>