Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 510 Vote(s) - 3.43 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Programming languages implemented in assembly language

#1
Recently I've stumbled upon [JONESFORTH][1], which is an interpreter for the Forth programming language implemented in plain assembly language.

I find this implementation interesting, because it shows how a language can be implemented in assembly language, although I understand that implementing a language can be a serious portability tradeoff.

So I wondered if there are any other programming languages implemented in assembly language, whose source are still available (and maybe are even still under active development)?

[1]:

[To see links please register here]

Reply

#2
While it is *possible* to write a language implementation in assembly, for most languages it is not really advisable to do so for a variety of reasons: assembly code is notoriously difficult to develop and maintain, and it is by definition not portable.

That said, some languages are significantly easier to produce implementations for:

- It is very easy to produce an [assembly implementation](

[To see links please register here]

) for [Brainfuck](

[To see links please register here]

)

- [Forth](

[To see links please register here]

) has a number of implementations in assembly, which is why it is used in the firmware of several non-PC workstations. You can find some assembly implementations for various platforms [here](

[To see links please register here]

).

- Many [BASIC](

[To see links please register here]

) interpretters have been written in assembly - in fact that was probably true for most BASIC implementations in the various home computers of the late '70s and early '80s. Some can be found [here](

[To see links please register here]

).
Reply

#3
Several versions of [Turbo Pascal][1] since 1.0 [were written in assembly language][2]. It was the only way to fit an editor, compiler, a debugger, and the compiled program into the 64 KB RAM of the time, and it provided for blazing edit-compile-debug speeds never witnessed before.

[1]:

[To see links please register here]

[2]:

[To see links please register here]


Reply

#4
Although not purely in assembly, the vm and some other sections of luajit is written in macro'd assembly, for multiple platforms (mainly x86), purely for the speed it provides (mike paul may have other reasons, but I beleive this is the main one). The macro processor is also custom built as well, using lua however.
Reply

#5
Pico Lisp recently (in the past few years) switched from C to x86-64 assembler. That's the only example I can think of that was undertaken in the "modern" era. There are some older Lisps bootstrapped from assembler still in use. Actually wait, someone recently wrote a Scheme in ARM assembler (

[To see links please register here]

). I don't know why they would have done such a crazy-sounding thing and I haven't looked at it closely. Of course it's very common to write in C and add some asm functions to implement call/cc or the like.

The BDS C compiler from the 1980's was written in 8080 assembler and the source code was released a few years ago, but it's mostly of historical interest.
Reply

#6
Ultimately every language is implemented in assembler, a c-compiler must map + to an assembler instruction, somehow, somewhere. There is only a great variability in how large a part of a language is in the assembler kernel, and how large part of the language is defined in the language itself.
If you look at jonesforth you will see that a part of the kernel, even in the assembler file, is in fact Forth code, not assembler code.

So the criterion may be whether the language of the main program is assembler or the language itself. More important may be whether a languages needs another language to be build, e.g. a lisp implementation in Pascal, Gforth implemented using C. It may be a liability to be dependant from a compiler that you don't control, and language standards that may make some practices obsolescent. Keeping up with new features of a processor in a compiler, requires in depth assembly knowledge, whether your compiler is written in itself or in assembly.

As long as you have the source the language is not dead. So you can look at FIG-Forth's (1980). jonesforth has part of its inspiration from my ciforth, an i86 assembler Forth for 16/32/64 bits.

I can recomment especially `` yourforth '' a Forth in assembler that I made specifically for educational purposes. It has exercises, but those are not completed yet:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through