lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Tim Hill once stated:
> 
> > On Jun 26, 2015, at 9:00 PM, Sean Conner <sean@conman.org> wrote:
> > 
> >  Also, there are programming languages where you can't use all the
> > features.  Yes, you can write your own version of printf() in C, but you
> > can't write your own version println() in Pascal.  Or your own version of
> > PRINT in Fortran.  This isn't meant as an excuse for why Lua is unable to
> > use itself to the full extent, but to show that not all programming
> > languages allow that.
> 
> Actually, following up on that, you can’t even do printf(). How do you do
> I/O? At the end of the day the core low-level functions in the C runtime
> MUST be coded either in assembler or using hidden compiler intrinsics to
> generate the necessary operations (such as raw OS calls).

  Depends on the system.  If the computer uses memory-mapped graphics (for
example, a bog-standard IBM PC from the 80s or 90s in text mode mapped to
0xB0000000 or 0xB8000000 [1] depending upon the video card) then yes, it can
be done in C.  But I'm afraid we're straying far from Lua here ...

  -spc (Or $0400 on the Tandy Color Computer [2])

[1]	Actually, B000:0000 or B800:0000 using the standard 8086
	segment:offset addressing mode, which translates to the physical
	address of 0xB0000 or 0xB8000

[2]	Why do I even *remember* this stuff from twenty-five to thirty years
	ago?   Sigh ...