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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Programming paradigms that change how people think about coding (2014)

128 点作者 lrsjng大约 6 年前

11 条评论

merlincorey大约 6 年前
Original HN discussion (linked at top of article as well): <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7565153" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7565153</a><p>I find it interesting that the discussion on Dependent Types lists Idris and Coq as languages and discusses Formal Verification but mostly focuses on Idris and Scala with Shapeless... but to my knowledge, Coq has actually won out in 2019 for this, and Coq has even branded itself for this specifically[0].<p>[0] <a href="https:&#x2F;&#x2F;coq.inria.fr&#x2F;" rel="nofollow">https:&#x2F;&#x2F;coq.inria.fr&#x2F;</a> - Coq is a formal proof management system.
slaymaker1907大约 6 年前
It&#x27;s not strictly a programming language, but Scribble (a Racket language) is really the first document creation language that neither feels like a markup language with a programming language API nor a programming language with a document creation API. With this sort of setup, it is really easy to introduce arbitrary new constructs to avoid duplication or to better structure your document.<p>LaTex is the only system I know that comes close to this, but the language is pretty horrible to actually try and use (to be fair, LaTex has quite a bit of legacy it has to maintain).
评论 #19336313 未加载
YeGoblynQueenne大约 6 年前
Prolog is declarative, but it&#x27;s very different to SQL and it&#x27;s a shame to put the two together. It is much more interesting to examine Prolog from the logic programming point of view.<p>Also:<p>1) The sorting example is O(n!) not because of limitations of the language, as the article suggests, but because the algorithm implemented is <i>permutation sort</i>, which is O(n!).<p>A typical sorting algorithm example in Prolog is merge sort which is as efficient in Prolog as merge sort can be. Here are a few sorting algorithms in Prolog, including merge sort and quick sort:<p><a href="http:&#x2F;&#x2F;kti.ms.mff.cuni.cz&#x2F;~bartak&#x2F;prolog&#x2F;sorting.html" rel="nofollow">http:&#x2F;&#x2F;kti.ms.mff.cuni.cz&#x2F;~bartak&#x2F;prolog&#x2F;sorting.html</a><p>2) The Sudoku example uses a Constraint Logic Programming library implemented in Prolog (from the looks of it, Gnu Prolog). CLP is a different paradigm than plain logic programming, where one programs by specifying constraints.<p>A Sudoku solver in actual Prolog can be found in &quot;99 Prolog Problems&quot;:<p><a href="https:&#x2F;&#x2F;www.ic.unicamp.br&#x2F;~meidanis&#x2F;courses&#x2F;mc336&#x2F;2009s2&#x2F;prolog&#x2F;problemas&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.ic.unicamp.br&#x2F;~meidanis&#x2F;courses&#x2F;mc336&#x2F;2009s2&#x2F;pro...</a><p>The sudoku solver is number 97.
kazinator大约 6 年前
Out of order calculation based on dependencies: <i>mlet</i> (magic let&#x2F;mutual let) macro:<p><pre><code> This is the TXR Lisp interactive listener of TXR 212. Quit with :quit or Ctrl-D on empty line. Ctrl-X ? for cheatsheet. 1&gt; (mlet ((w 3) (x (+ z w)) (z (* 2 w))) (list x z w)) (9 6 3) </code></pre> Obligatory macro-expansion:<p><pre><code> 2&gt; (macroexpand &#x27;(mlet ((w 3) (x (+ z w)) (z (* 2 w))) (list x z w))) (let (#:g0011 #:g0012 #:g0013) (symacrolet ((w (force #:g0011)) (x (force #:g0012)) (z (force #:g0013))) (set #:g0011 (delay 3)) (set #:g0012 (delay (+ z w))) (set #:g0013 (delay (* 2 w))) (list x z w))) </code></pre> Circular dep naturally fails:<p><pre><code> 1&gt; (mlet ((x y) (y z) (z x))) nil 2&gt; (mlet ((x y) (y z) (z x)) x) ** (expr-2:1) force: recursion forcing delayed form y (source location n&#x2F;a)</code></pre>
评论 #19341175 未加载
评论 #19334483 未加载
ktpsns大约 6 年前
&gt; It’ll be very interesting to see if the symbolic programming model is as flexible as Wolfram claims and can truly take advantage of all of this data.<p>Wolfram could have implemented his large standard library also for any other ecosystem. The magic of this library (which goes along with Wolfram&#x27;s Lisp dialect but is considered as a unit) is that it is extremely high level, allowing rapid application development. But as with most libraries, it could have been developed for any language&#x2F;idiom, such as a traditional object oriented python.
评论 #19332905 未加载
kazinator大约 6 年前
The dependent types example seems underwhelming; rejecting arrays of unlike length at compile time is something I&#x27;d expect from a Pascal compiler from 1975.<p>How about C90: pointer to array of 10 is not compatible with a pointer to array 20:<p><pre><code> int process_array(int (*pa)[20]); int main(void) { int array[10]; process_array(&amp;array); return 0; } </code></pre> GCC:<p><pre><code> array.c: In function ‘main’: array.c:6:17: warning: passing argument 1 of ‘process_array’ from incompatible pointer type [-Wincompatible-pointer-types] process_array(&amp;array); ^ array.c:1:5: note: expected ‘int (*)[20]’ but argument is of type ‘int (*)[10]’ int process_array(int (*pa)[20]); ^~~~~~~~~~~~~</code></pre>
评论 #19334606 未加载
评论 #19334583 未加载
评论 #19335594 未加载
评论 #19336622 未加载
sktrdie大约 6 年前
Too bad Behavioral Programming isn’t discussed as I find it to be the most fascinating one especially because its main objective is to better align programming to how humans think: <a href="https:&#x2F;&#x2F;lmatteis.github.io&#x2F;react-behavioral&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lmatteis.github.io&#x2F;react-behavioral&#x2F;</a>
Criper1Tookus大约 6 年前
Another strange language feature I could imagine seeing here: Constraint Logic Programming
jayd16大约 6 年前
Wolfram always impresses me but I can&#x27;t help but feel like it will never go anywhere. How can it grow without being crushed under its own weight? As he stated in the video, its all hand crafted data set munging to fit it all together.<p>I&#x27;d love to see a world where wolfrom pulls on datasets out in the wild much like a search engine scrapes web pages but is such a thing possible? It begins to sound like a SOAP&#x2F;WSDL fever dream when you think about automatic knowledge integration.<p>Maybe something closer to the open source package managers? Wolfram datasets could specify interfaces and dependencies? At least that would allow for new and exciting datasets to gain adoption in the community.
评论 #19336611 未加载
dang大约 6 年前
Could you please edit personal swipes out of your comments to HN? Your post would be excellent without the first bit.<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;newsguidelines.html" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;newsguidelines.html</a>
评论 #19335304 未加载
评论 #19334954 未加载
WhuzzupDomal大约 6 年前
Anyone that has used a third-party API or written a parser understands all they need to about declarative languages...