Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Francois Lionet is creating AMOS 2

Author
Message
SpecTre
Developer
16
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 28th Oct 2018 23:10
Just found this on the web!

https://www.patreon.com/francoislionet?fbclid=IwAR3Osegbi3Vtxoieouf9rXbxICctejH9l_WjsJS0h2jG1m5VcNlLhk-s3cQ

New version for the new machines of today but the bit that interests me is that it will run all your old Amiga projects on modern equipment!
I have boxes of Amiga disks in the loft with my old projects from the Amos days so this could be interesting

Remember Amos PD?
Bored of the Rings
14
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 29th Oct 2018 09:04
this is interesting, yes remember all the PD soft stuff, still have a lot of FISH disks and other PD software and original AMOS Pro disks + compiler etc. Great days of that day.
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
SpecTre
Developer
16
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 29th Oct 2018 17:15
Yes loved Amos, it was great and also a great community too like here.
Kevin Picone
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 23rd Dec 2018 14:05
you can already run your AMOS apps on todays hardware .. fire up your favorite a port of UAE

I did write a simple translator a few years ago.. Convert the core language stuff and avoid command sets as you can use wrappers for such things

PlayBASIC To HTML5/WEB - Convert PlayBASIC To Machine Code
Mikko
16
Years of Service
User Offline
Joined: 25th Sep 2002
Location: Finland
Posted: 28th Jan 2019 18:50 Edited at: 28th Jan 2019 21:18
Hi, I put the latest readme from the Amos2 here.
Mikko
-----------------------------------------------------------------------------------


# AMOS 2 Compiler version 0.1 - 28/01/2019
## *By Francois Lionet - francois@francoislio.net*

## **Welcome to the second version of the AMOS 2 Compiler!**

A lot of work done this week.

- Shared and Global keywords, allowing you to control how procedures deal with variables
- Dim, single and multidimensional arrays
- Data, Read, Restore
- Proper keyboard handling. You now end a program by pressing the classic CONTROL-C
- Inkey$: keycodes are converted to the Amiga equivalent to be compatible
- Mouse handling. X Mouse and Y Mouse as functions (you cannot set the position of the mouse for the moment)
- Change Mouse, Show, Show on, Hide, Hide on, Mouse Key, Mouse Click
- Error messages and error management in the running application. You now get proper 'Illegal function call' errors when you call a function with improper parameters
- Math function: Sgn, Abs, Int, PI#, Min, Max, Sin, Cos, Tan, Asin, Acos, Atan, Sqr, Log, Exp (not tested - still to do: Hsin, Hcos, HTan (trigonometrical functions only in degrees for the moment)
- Graphic functions: Plot, Draw, Draw to, Circle, Ellipse, Bar, Box, Gr Locate, =Xgr, = Ygr, Ink (but for the pattern parameter),
- New option (set as default in this version) to include the line number of each instruction in the compiled application, allowing proper runtime errors reporting (like 'Illegal function call error at line 10 column 5)

To sum up:
- Compiler -> 95% done
- Control instruction (like For/Next - If/Then etc) -> 100% done
- Procedures -> 100% done
- Error management (on error goto / on error proc / error reporting) -> 100% done
- Keyboard and mouse -> 50% done
- Graphic functions -> 75% done (still Paint and patterns to do)
- Text windows -> 50% done
- Mathematical functions -> 80% done
- String functions -> 75% done

The Helloworld application included in this folder contains a little (very little, please make some more impressive) demo of the new graphical and math functions.

AMOS 2 is taking shape nicely. Most of the work on the compiler itself is done, adding new instructions or function is a matter of minutes, I can concertrate on the runtime library that makes the program work.

My plan for the week to come:

- Finish the graphical instructions, implement graphic fonts
- Finish the remaining mathematical functions
- Complete the text Windows (Wind Open, Wind Close etc), find a better default font
- Implement Pixi.js as a renderer

If I manage to keep on this pace, I see Sprites, Bobs and AMAL completed at the end of February (can't wait to program AMAL, gonna be a lot of fun in Javascript!)... And we will be able to program the first real games in AMOS 2!

See you next week!

Francois


## Executables
You will find the executable version of the compiler at: https://drive.google.com/drive/folders/189QBsS_Py9TUWE4jfacxpkuwjQ4j1TBU?usp=sharing

- amosc-win.exe -> for Windows
- amosc-linux -> for Linux
- amosc-macos -> for MacOS

Yeah I know, these files are quite big. I will try to find another package maker for node. Anyway, they launch real quick. Copy the file at the root of the 'amos-2' directory.

## Try it!
This directory contains a Hello world application in the 'application' folder. To try the compiler, open a command line window, go in the directory where the compiler is located (normally the root of the 'amos-2' directory), and type:

amosc-win.exe ./applications/helloworld

You should obtain a message:
'Compilation successful.'

Now open a explorer, and look inside of the 'applications/helloworld' folder. You will find a 'html' folder that contains the compiled application ready to be launched, the entry point being the file 'index.html'. To launch this application, open your browser and type the full path to the index.html file in the address bar. The application should be displayed in your browser!

## What is done today?

- the compiler
- variables
- arrays, dim
- procedure / end proc / shared / global
- for / next / step
- repeat / until
- while / wend
- do / loop
- exit / exit NUMBER / exit if
- if / then / else / endif (else if still to be done)
- on NUMBER goto / gosub / proc
- on error goto / proc
- resume / resume LABEL / resume next / resume label
- goto / labels
- gosub / return
- errors in runtime
- locate
- clw
- home
- print
- left$ / mid$ / right$
- chr$
- space$
- upper$
- lower$
- val
- len
- tab$
- pen
- paper
- centre
- border (has no effect yet)
- writing
- title top / bottom (no effect yet)
- under on / off
- scroll on / off
- scroll
- cup / cdown / cleft / cright /note that the cursor is not yet visible)
- memorize x / y
- hscroll / vscroll
- set tab
- gr locate
- plot
- draw, draw to
- circle, ellipse
- bar, box
- ink
- xgr, ygr
- abs, int, sgn
- sin, cos, tan
- asin, acos, atan
- log, exp
- sqrt
- inkey$
- change mouse, x mouse, y mouse, mouse key, mouse click


## Create your own AMOS 2 application

To create your own AMOS 2 application, follow the steps:

- copy the 'helloworld' folder into another folder in the 'applications' directory
- rename 'helloworld.amos' to 'myprogram.amos'
- open your favorite source code editor
- load the file 'manifest.hjson', it contains the default definition of the program. Change the section 'infos/start' and enter the name of your .amos file. You can also change the default screen size and color. The 'display' section contains the definition of the main canvas element that will contain the display. These information are copied into the 'index.html' file when compiling. Note the 'zoomX' and 'zoomY' values: they are mandatory to scale the default AMOS red screen (320 x 200) into a size that is compatible with today's resolution. I have not yet worked on full screen, it will come in the future.
- load the file 'myprogram.amos' and type your code! Please note that this is the very first public version of the compiler, I have not tested real code. Please consider it as a toy for you to play with, with simple code.
- Unlike the original AMOS, the names of the variable IS case-sensitive. So a variable name 'hello' will not be the same as 'Hello'. I think I will put that as an option for compilation.

Of course, in the future, you will be able to create a new application with a simple command:

amosc -new myprogram.amos ... and it will copy the manifest and create the proper folders.

## Note on the code produced

Once you have compiled a program, you will find the code in the file 'application.js' in the 'myapplication/html/run' folder. You might be surprised by the code produced, and how it is sliced in blocks. It is the only way to proceed to port a language such as Basic into Javascript. Javascript does not allow endless loops or gotos, so the program must be run 'from above' and control on the execution must be possible at each time.
- first to avoid taking all the processor time, and render Chrome inoperant.
- second to allow goto and error catching the Basic way, with On Error Goto...

### The compiler has for the moment two way of producing code.

- 'fast' code: if your program do not contain any 'On Error', the Javascript instructions are grouped as much as possible, and the number of block is reduced.
- 'slow' mode: if an 'On Error' instruction has been detected in the first pass of compilation, the compiler will produce one block of code per instruction. It is the only way to allow 'Resume' and 'Resume Next'. Such mode wuill be slower, I still have to do some benchmarking.

### Where is the main loop?

The code that calls all the blocks contained in 'application.js' can be seen in the file 'runtime/amos.js'. You will see that the loop is verfy simple and no time is lost between calling each block of code. You will also see that I artificially slow down the execution.

### About the speed of execution:

I am sure that many of you will try to have an idea of the speed of the code produced. And you will be deceived as I artificially slow down the execution to avoid cluttering Chrome. Here too, experimentation must be done to find the best setting that will at the same time allow the program to run at maximum speed without putting the user's machine in danger.
Anyway, my first goal is to allow native Amiga AMOS programs to run, and I am sure that I will have to slow down the code even further to achieve compatibility. We will see!

### In the future

I will make a 'fastest' mode that will NOT cut the code into blocks, or only the minimum. The code produced will be then pure Javascript and the speed of execution will be comparable to the speed of real Javascript.

I will also implement the possibility to insert real Javascript code in the middle of the Basic code, for time-critical sections. Example:

```
Procedure GoFast[ A, B ]
{
// We are in Javascript now!
this.retValue = 0; // This variable will be accessible in Basic
for ( var x = 0; x < 100000; x++ )
{
this.retValue += this.pA * this.pB; // Stupid example, but shows how to get the variables.
}
}
' Back to Basic!
Param retValue ' Return the variable defined int he Javascript portion
End Proc
```

## Please help and share!

Although it is a very early version, any report on things that are supposed to work and don't is welcomed. Just post your comments on Patreon.

Please share!

I am doing this project alone on my free time. It is a big project, and any support on Patreon is more than welcomed. I do not post on Facebook anymore to save time (a lot of time saved since I stopped going there), so you are the ONLY people who can make this project popular and help increase the number olf Patrons. Plkease share such posts in the Amiga forums on FB, on your page... everywhere you can!

And if you are not yet one of my Patrons, you are welcomed to help: www.patreon.com/francoislionet

All for today! See you next week for a new version. Until then I will post my progress day by day in my thread.

Francois
mikko_ketonen( )hotmail.com
DavidAGK
5
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 28th Feb 2019 11:29
Loved AMOS - brings back so many good memories! Nice to hear Francois is creating a new version all this time later. Wonder how fast it will execute?

Unless it brings something new to the table however, I'll be sticking with AppGameKit - when you create games over many years (as many indie coders do!) you really need confidence that the coding product will survive/thrive in the long term.

I'll be keeping an eye on it though - even if it is just for nostalgia!

Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
GarBenjamin
AGK Developer
2
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 7th Mar 2019 00:23 Edited at: 7th Mar 2019 00:23
That's pretty cool but might be even better if people like Francois, Mark and others got together with TGC to make the AGKS even more amazing. But I guess probably each person has their own way of doing things so such a collaboration might not work well.

Login to post a reply

Server time is: 2019-05-22 15:36:14
Your offset time is: 2019-05-22 15:36:14