Welcome, Guest. Please login or register.

Author Topic: Lua interpreter with arbitrary precision math lib.  (Read 5458 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline ThorhamTopic starter

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1149
    • Show all replies
Lua interpreter with arbitrary precision math lib.
« on: October 18, 2014, 11:46:45 PM »
Here's a build of the Lua interpreter from Lua 5.2.3: Lua

Works with Kicstart 3.0+ and 68020+ (only tested with 68030). Compiled with SASC6.58, so might work with Kicstart 2+. Does NOT require an FPU, ixemul.library, etc. Only needs standard Workbench libraries. This build of Lua doesn't support loading dynamic libraries.

To use, simply unpack the archive anywhere you want, and start from Workbench. You can also run lua.exe from the CLI directly. When starting from the CLI, use lua.exe -l mapm to start the interpreter with the math library.

Example usage of arbitrary precision floating point commands (type into the interpreter command line directly):

Code: [Select]

mapm.digits(100)
a=mapm.sqrt(12345)
b=mapm.sqrt(54321)
print(a*b)
c=mapm.number(1)
d=mapm.number(3)
e=c/d
print(e*d)
You can also use things like mapm.sin, mapm.cos, etc.

Currently there's no documentation, but you can get some pointers here:

mapm: http://www.tc.umn.edu/~ringx004/mapm-4.9.5a.tar.gz
lmapm: http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/5.2/lmapm.tar.gz

Mapm is the arbitrary precision floating point library. This contains documentation about the functions. Lmapm is the code that links mapm to lua. The file lmapm.c will show you which functions are available in the interpreter. Sorry, but it will have to do for now.
 

Offline ThorhamTopic starter

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1149
    • Show all replies
Re: Lua interpreter with arbitrary precision math lib.
« Reply #1 on: October 19, 2014, 08:01:11 PM »
No views at all? No one is interested in Lua here?
 

Offline ThorhamTopic starter

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1149
    • Show all replies
Re: Lua interpreter with arbitrary precision math lib.
« Reply #2 on: October 20, 2014, 04:15:09 PM »
Quote from: wawrzon;775296
i suppose on eab there will be more feedback.
You'd think so too.

Quote from: psxphill;775298
I was intrigued what purpose lua has & I haven't had any answer to that.
The reason for this port is that I wanted a programmable calculator with arbitrary precision floating point math.

Quote from: OlafS3;775301
Is it compatible to AmiLua?
No idea. This is just the interpreter from Lua 5.2.3 with built-in mapm 4.9.5a.

Quote from: OlafS3;775301
I have integrated it in Aros Vision and would update it with your version as long as it does not destroy it
Right now you can't. This is only a quick release of the interpreter. Furthermore, it seems that SASC6.58 didn't compile this version completely right (compiler options). I'll upload an updated version later.

For Aros I would just use the version from the Lua site, and build it. You can build it with just about anything.