TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

From Languages to Language Sets

64 pointsby whatever32 months ago

16 comments

andyferris2 months ago
One thing I&#x27;ll note is we tend to use languages from different levels in different settings (front end, back end, systems) and we spend an awful lot of time writing glue code to get them to talk to each other.<p>A major advantage of the proposed approach is automated FFI and serialization&#x2F;deserialization between languages in the same language set. RustScript would be able to accept a struct or enum from Rust or RustGC, and vice-versa. You could have a channel with different languages on either end.<p>You can also see that we _want_ something like this, e.g. we bolt TypeScript on top of JavaScript, and types onto Python. If JavaScript (or python) were designed so they could be more easily compiled (notably, no monkey patching) then they would support level 2 as well.<p>I have been thinking of level 2 or 1 languages that support the higher levels. This is a really good framing. (The problem with going the other way is the implementation decisions in the interpretter often constrain how the compiler can work, e.g. CPython is dominant because all the libraries that make use of the CPython FFI, and similarly for NodeJS. It is easier to interpret a constrained language than to compile a dynamic language designed with an interpretter in mind).
评论 #43384056 未加载
评论 #43386115 未加载
notarobot1232 months ago
I think Peter Naur&#x27;s description of levels of computation is a better one for considering an actual layering of levels of abstraction:<p>&gt; Each level is associated with a certain set of operations and with a programming language that allows us to write or otherwise express programs that call these operations into action. In any particular use of the computer, programs from all levels are executed simultaneously. In fact, the levels support each other. In order to execute one operation of a given level, several operations at the next lower level will normally have to execute. Each of these operations will in their turn call several operations at the still lower level into execution.<p>The old term &quot;problem-oriented languages&quot; seems to still be quite useful. Programming languages are always focused on allowing the programmer to solve a set of problems and their features hide irrelevant details.<p>These language sets seem like a helpful grouping of features that suit particular problem domains but I don&#x27;t think it works as a taxonomy of levels of abstraction.
layer82 months ago
There is something to be said for the three languages (“levels”) to actually look sufficiently different from each other, so that when looking at some code it’s immediately clear which one it’s in. Making them too similar increases the likelihood of mistaking which one you’re in, and applying the mindset of one to the other.<p>Another reason to do that is that the different levels are amenable to different affordances, and have different trade-offs in their design. For example, at level 4 you may want to go for a more BASIC-like syntax, without semicolons, and commands without argument-list parentheses.
teaearlgraycold2 months ago
I’m a strong supporter of adding an automatic GC to Rust. Although it seems difficult to justify as RustGC code wouldn’t be trivial to convert to traditional Rust. But going in the opposite direction should be trivial.
munificent2 months ago
<i>&gt; One language could combine the 2nd and 3rd level though. A language that can be interpreted during development for fast iteration cycle, but compiled for better performance for deployment. There isn’t such a language popular today though.</i><p>I&#x27;m not sure if Dart counts as &quot;popular&quot;, but it otherwise fits this bill. It has a JIT and can startup pretty quickly and interpret on the fly. You can also hot reload code changes while a program is running. And it can ahead-of-time compile to efficient machine code when you&#x27;re ready to ship.
评论 #43390766 未加载
tmtvl2 months ago
A language which can be either interpreted or compiled doesn&#x27;t exist? Nobody tell the Common Lispers, they&#x27;d vanish in a puff of logic.
emidln2 months ago
This is one of the reasons I like Clojure. There are very useful dialects with broad overlap between:<p>Browser &#x2F; JavaScript environments -&gt; ClojureScript<p>General Purpose (JVM) -&gt; Clojure<p>Fast Scripting -&gt; Babashka (although I&#x27;ve used ClojureScript for this in the past)<p>C&#x2F;C++ Interop (LLVM-based) -&gt; Jank (new, but progressing rapidly and already useful)<p>I can largely write the same expressive code in each environment, playing to the platform strengths as needed. I can combine these languages inside the same project, and have libraries that have unified APIs across implementation. I can generally print and read EDN across implementations, provided I register the right tag handlers for custom types (this is one area jank still has to catch up). Reader conditionals allow implementation-specific code as needed.<p>I&#x27;m really excited about Jank giving me a good alternative to JNI&#x2F;JNA&#x2F;Panama when I need my Clojure to touch OS parts the JVM hasn&#x27;t wrapped.
rickcarlino2 months ago
This is a better taxonomy of what a language is rather than the dated concept of “High-level” vs. “Low-level”.
flufluflufluffy2 months ago
Level 4 and level 3 have equal performance. The benefit is in the developer experience. But also just use what you like man. Or what fits the task at hand. Most of the “problems” this and other articles like it bring up are so overblown and exaggerated.
kerkeslager2 months ago
&gt; Now let’s address level 4. Big players sit at this level, perhaps the most popular languages by headcount of their programmers. The problem with a lack of static typing is that it’s hard to work on such code in groups and at scale. Every successful business started with those languages eventually rewrites their codebase to use one of the “lower level” languages because big codebases written by many people are hard to maintain and modify without the support of a static type-checker. They are still great languages for solo, small projects, especially if the code can be easily automatically tested.<p>This is total made up nonsense. I&#x27;ve worked in Python for over a decade, and at multiple successful companies that have been running quarter-million plus line Python codebases for 8+ years.<p>Proponents of static typing like to sound alarms that it&#x27;s impossible to scale dynamic codebases when they lack the experience in those languages to know people solve scaling problems in those languages.<p>I&#x27;m not hating on static languages, but I think they involve more tradeoffs than proponents of static typing admit. Time spent compiling is pretty costly, and a lot of codebases go to great lengths to somewhat bypass the type system with dependency injection, which results in much more confusing codebases than dynamic types ever did.<p>Meanwhile, many of the worlds largest and longest-maintained codebases are written in <i>C</i>, which is only half-assed type checked at any point, and is much harder to maintain than dynamic languages. The idea that projects reach some point of unweildiness where <i>every</i> one of them gets rewritten is just not correct.<p>I might have gone a bit easier on this if the author hadn&#x27;t said &quot;<i>Every</i> successful business...&quot;--the word &quot;every&quot; really is just way too far.<p>EDIT: I&#x27;ll also note that just because a language isn&#x27;t statically typed, doesn&#x27;t mean it gains no benefit from type checking. JavaScript and Python are not created equal here: JavaScript will happily let you add NaN and undefined, only to cause an error in a completely unrelated-seeming area of the codebase, whereas Python generally will type check you and catch errors pretty close to where the bug is.
评论 #43389273 未加载
gabrielsroka2 months ago
2022<p><a href="https:&#x2F;&#x2F;hn.algolia.com&#x2F;?query=From%20Languages%20to%20Language%20Sets&amp;type=story&amp;dateRange=all&amp;sort=byDate&amp;storyText=false&amp;prefix&amp;page=0" rel="nofollow">https:&#x2F;&#x2F;hn.algolia.com&#x2F;?query=From%20Languages%20to%20Langua...</a>
Peteragain2 months ago
A nice summary of the issues is my top-level comment. So Java, Vs JavaScript is in here somewhere. My take on it is that java keeps getting extended to look more like JavaScript, and inevitably becomes slower.
jimbokun2 months ago
Where would Haskell go?<p>Erlang and Elixir?
评论 #43385292 未加载
评论 #43385310 未加载
评论 #43386601 未加载
jasonthorsness2 months ago
Especially with LLMs to assist we don&#x27;t gain much anymore from making everything one syntax, one language, etc. Projects like Dotnet Blazor&#x2F;ASP.NET or Python Streamlit&#x2F;Dash IMO are forced and are more trouble than they are worth. The OP suggestion, where everything is Rust, has the same problem; it&#x27;s too forced.<p>We should embrace the domain-specific niceties; there are room for lots of languages, they can iterate more quickly, try new things, and specialize syntax to the domain.
chubot2 months ago
I generally agree with the 4 tier categorization:<p><pre><code> 1. C&#x2F;C++&#x2F;Rust 2. Java&#x2F;Go&#x2F;OCaml 3. MyPy, TypeScript 4. Python, JavaScript </code></pre> But I&#x27;d also add 2 or 3 more tiers:<p><pre><code> 5. String-ish languages without GC - Shell, Awk, Make, CMake [1] 6. Configuration Languages - YAML &#x2F; TOML - declaring data structures [2] 7. Data Notations - JSON, HTML, CSV - Objects, Documents, Tables [3] </code></pre> The goal of YSH is actually to *unify tiers 4, 5, 6, and 7* under one language. The slogan I&#x27;ve been using is &quot;minimal YSH is shell+Python+JSON+YAML&quot;<p>Instead of having Unix sludge (autotools - m4 generating make) and Cloud sludge (Helm - Go templates generating YAML), you have one language<p><pre><code> - YSH is the code dialect -- it is a shell with real data types like Python - and with reflection like Ruby&#x2F;Python, not generating text - Hay (Hay Ain&#x27;t YAML) is the data dialect - and we have built-in JSON, etc. </code></pre> This is a hard design challenge, but I just made a release with an overhaul of Hay - <a href="https:&#x2F;&#x2F;oils.pub&#x2F;release&#x2F;0.28.0&#x2F;" rel="nofollow">https:&#x2F;&#x2F;oils.pub&#x2F;release&#x2F;0.28.0&#x2F;</a><p>Hay version 1 was hard-coded in the interpreter - <a href="https:&#x2F;&#x2F;oils.pub&#x2F;release&#x2F;0.28.0&#x2F;doc&#x2F;hay.html" rel="nofollow">https:&#x2F;&#x2F;oils.pub&#x2F;release&#x2F;0.28.0&#x2F;doc&#x2F;hay.html</a><p>But we realized it&#x27;s actually better to self-host it in YSH, using YSH reflection. We will be testing this by rewriting Hay in YSH<p>---<p>So that&#x27;s our language design response to <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43386115">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43386115</a><p>&gt; It&#x27;s madness that languages are effectively siloed from each other.<p>Instead of tiers 4, 5, 6 being silo&#x27;d, we have them all under YSH and the Oils runtime (which is tiny, 2.3 MB of pure native code).<p>(As a bonus, OSH also runs on the Oils runtime, and it&#x27;s the most bash-compatible shell!)<p>----<p>[1] <i>Garbage Collection Makes YSH Different</i> - <a href="https:&#x2F;&#x2F;www.oilshell.org&#x2F;blog&#x2F;2024&#x2F;09&#x2F;gc.html" rel="nofollow">https:&#x2F;&#x2F;www.oilshell.org&#x2F;blog&#x2F;2024&#x2F;09&#x2F;gc.html</a><p><i>Shell, Awk, and Make Should Be Combined</i> - <a href="https:&#x2F;&#x2F;www.oilshell.org&#x2F;blog&#x2F;2016&#x2F;11&#x2F;13.html" rel="nofollow">https:&#x2F;&#x2F;www.oilshell.org&#x2F;blog&#x2F;2016&#x2F;11&#x2F;13.html</a> - all these languages lack GC!<p>[2] Survey of Config Languages - <a href="https:&#x2F;&#x2F;github.com&#x2F;oils-for-unix&#x2F;oils&#x2F;wiki&#x2F;Survey-of-Config-Languages" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;oils-for-unix&#x2F;oils&#x2F;wiki&#x2F;Survey-of-Config-...</a> - divides this category into 5 tiers:<p><pre><code> 1. Languages for String Data 2. Languages for Typed Data 3. Programmable String-ish Languages 4. Programmable Typed Data 5. Internal DSLs in General Purpose Languages </code></pre> [3] <i>Zest: Notation and Representation</i> addresses this - <a href="https:&#x2F;&#x2F;www.scattered-thoughts.net&#x2F;writing&#x2F;notation-and-representation&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.scattered-thoughts.net&#x2F;writing&#x2F;notation-and-repr...</a><p>YSH also has a common subset with J8 Notation (which is a superset of JSON)
HumanOstrich2 months ago
TLDR; Let&#x27;s rewrite everything in 3 languages: Rust, RustGC, and RustScript!<p>Ugh.
评论 #43386999 未加载