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.

Ask HN: definition of a highlevel language?

5 pointsby globalrevalmost 17 years ago
(might not be the right forum for this but...)<p>what is the definition of a highlevel-language?<p>well there isnt one specifically and wikipedia and the like gives just a very general description obv you can say it abstracts away lowerlever operations.<p>yes but how?<p>a function like map takes a function and applies it to a list for example. this abstracts away a common procedure like iterate through a list and for every position do a computation. so it is a higherorderfunction. is this how higher-level-languages are built?<p>so are they fundamentally differently built or is it just a lot of lowlevel operations built on top of each other?<p>haskell is considered a very highlevellanguage but can you do systemsprogramming with it(yes maybe it is very unpractical i dont know but can you)?<p>is lambda calculus a more abstract and efficient way of modeling a compututation? meaning you start at a higher level of abstraction and can work up to even higher even faster?<p>how did lispmachines work? was the basic system programmed in LISP?

9 comments

aaronblohowiakalmost 17 years ago
In the beginning, there was machine code. this is essentially inputting what the computer actually executed, without any translation or compilation ( <a href="http://en.wikipedia.org/wiki/First-generation_programming_language" rel="nofollow">http://en.wikipedia.org/wiki/First-generation_programming_la...</a> )<p>Then there was assembler/assembly. This is similar to the aforementioned, except easier to read. Assembly is a 1:1 mapping between symbols and their machine-understandable counterparts. This is the first step in the abstracting of programming code from executable code ( <a href="http://en.wikipedia.org/wiki/Second-generation_programming_language" rel="nofollow">http://en.wikipedia.org/wiki/Second-generation_programming_l...</a> )<p>Then, there are so-called 3GL. These let you do fancy things like having named variables, symbolic manipulation, function calls, abstract (arbitrary) syntax. This encompasses many of the languages people use at work today (c/c++/java) ( <a href="http://en.wikipedia.org/wiki/Third-generation_programming_language" rel="nofollow">http://en.wikipedia.org/wiki/Third-generation_programming_la...</a> ) It is important to note that the purpose of 3GL, like assembly before it, was to create a separation between what the programmer typed and what the machine ran. The latter being derived from the former according to its rules.<p>( <a href="http://en.wikipedia.org/wiki/Fourth-generation_programming_language" rel="nofollow">http://en.wikipedia.org/wiki/Fourth-generation_programming_l...</a> ) 4GL are the next step along this line. The focus of 4GL is to make it that the code entered is as focused on the domain logic as possible, hiding the implementation details.<p>The phrase "further from the machine and closer to the domain"in the wikipedia 4GL page sums it up nicely.<p>To a chip designer, machine code is a high level language (it is an abstraction of the machine itself.) To an assembly programmer (nobody programs in machine code AFAIK,) c is a high-level language. To a c programmer, java is a high-level language. To a java programer, ruby is a high-level language. To a ruby programmer, RSpec is a high-level language.<p>Essentially, the further you get from the machine, the higher the level.<p>As far as the implementation of languages, well that depends. You can very well implement any language in assembly or machine code (given enough time, patience, and self-loathing.)<p>Usual strategies for the development of high-level languages are to either a) translate to a lower-level language that then gets compiled to machine code b) translate to a lower-level language that targets a virtual machine that eventually translates these lower-level instructions to machine code or c) some combination of a &#38; b until enough of your new language has been written so that it can translate itself to machine-code or vm bytecode (known as self-hosting.) high-level languages can sometimes be seen as collections of cool libraries that translate your code into lower-level languages, on and on until you eventually get to machine code. of course, people who write these translators are smart folk, and sometimes manipulate what you have written to make it run faster.<p>but yes, eventually, almost all languages become machine code in order to be executed (or are converted into control flags that configure the operation of existing machine code / configure an fpga or other type of bendy silicon.)<p>now, were lisp machines self-hosted? i dunno.<p>the implementation of Ruby is open-source, and mostly-readable C. watch a movie about ruby from the inside (some knowledge of c is useful)<p><a href="http://mtnwestrubyconf2008.confreaks.com/11farley.html" rel="nofollow">http://mtnwestrubyconf2008.confreaks.com/11farley.html</a><p>read more about the same:<p><a href="http://eigenclass.org/hiki.rb?ruby+internals+guide" rel="nofollow">http://eigenclass.org/hiki.rb?ruby+internals+guide</a><p>---<p>5GLs are even more abstract. instead of solving the problem in the domain space, you merely specify the constraints on the possible solutions and the computer provides you with solutions that satisfy all constraints. this offloads the work of figuring out how to solve the problem to a bit of problem-solving code. Programming a generic problem-solver that finishes in an acceptable amount of time on existing hardware in most cases is EXTREMELY difficult to do, so you need to let the consumer of the 5gl specify some control logic and provide hints to the problem solver. How to make this all work right, fast and make it more palatable than having a nice 4GL is not a solved problem.<p>Rumor has it that there are members of the cult of Logic Programming planning a re-emergence from the shadows and sewers. ( <a href="http://www.cs.kuleuven.ac.be/~dtai/projects/ALP/newsletter/feb04/nav/van_emden/van_emden.pdf" rel="nofollow">http://www.cs.kuleuven.ac.be/~dtai/projects/ALP/newsletter/f...</a> )
gillsalmost 17 years ago
Most abstractions are a little leaky, and we usually need to consider the 'how' when specifying the 'what'. For example, adding numbers in C can be accomplished with the abstraction '+', but the programmer must consider whether the operation will overflow the register on the underlying machine. Some even-higher-level languages plug that leak by providing a numerical hierarchy that will not overflow due to constraints imposed by the underlying hardware.<p>So I would say "higher-level languages" provide less-leaky abstractions. One can specify 'what' without specifying 'how', and one can make assumptions about the way exceptional cases are handled. The ideal language would provide leak-free abstractions but still allow the programmer to dive into any level.<p>There is probably a lot more to say than that.
kenalmost 17 years ago
"A programming language is low level when its programs require attention to the irrelevant." --Alan Perlis
msgalmost 17 years ago
<a href="http://steve-yegge.blogspot.com/2008/05/dynamic-languages-strike-back.html" rel="nofollow">http://steve-yegge.blogspot.com/2008/05/dynamic-languages-st...</a><p>So one way to say it is that high-level languages are like porno, "I know it when I see it." Another way to say it is that there's machine language... and everything else. Or fill in the blank for machine language, "C is the last low-level language, everything more abstract is a high-level language".<p>It's tempting to think of memory-managed languages as high-level languages, but then there's Java...<p>Ratio of code size to payload is of course another metric.<p><a href="http://paulgraham.com/power.html" rel="nofollow">http://paulgraham.com/power.html</a><p>Maybe it's the functional languages.<p>Why do you ask?
bayareaguyalmost 17 years ago
One language is higher level than another one for a given problem when it allows a solution to a given problem to be specified in a way that introduces a minimum of concepts and issues external to the domain of the problem.<p>For example if your problem is to allow a doctor to find the best treatment for a patient with a given disease, you would say an expert system that allows said doctor to express the medical facts and reason about them is higher level than something like Lisp and a raw REPL because the last thing the doctor presumably wants to worry about is something like how a given data structure is implemented.
yanalmost 17 years ago
I think asking what a high level language is akin to asking "What is tall?" If you're talking about buildings, tall can mean one thing, if you're talking about toddlers, tall can mean another. Haskell can seem like a low-level language to, say, English.<p>A "level" of a language is a very relative concept, but you can approximately define a hierarchy of languages relating the level of one language to another using some arbitrary comparison.<p>Since my background is in operating systems and some compilers, I'd say anything C and anything higher level is "high level," but then again, that can mean anything :)
jwsalmost 17 years ago
I think a high level language is anything other than assembly language. That is from the perspective of someone that started with machine code and assembly language.<p>I don't think anyone ever set out to create a "low level" language. There was simply "coding the machine directly" and then "high level language".<p>Now it is tempting to draw a multidimensional line in the features of languages and partition it into "high" and "low", but I don't think that is where the term originates. It is a one hand clapping sort of adjective.
评论 #200442 未加载
anamaxalmost 17 years ago
&#62; how did lispmachines work? was the basic system programmed in LISP?<p>Yes. However, I'm not sure why that's relevant.
prestyalmost 17 years ago
high level languages are languages that are close to natural language
评论 #200516 未加载
评论 #200422 未加载