How do you make a QL emulator?

Discussion and advice about emulating the QL on other machines.
stevepoole
Trump Card
Posts: 225
Joined: Mon Nov 24, 2014 2:03 pm

Re: How do you make a QL emulator?

Postby stevepoole » Wed Feb 12, 2020 9:26 am

Hi Norman,

Thanks for the docs on Python. It makes very interesting reading.

But one last question.... Will Python programs work on PCs, tablets and smartphones as attatchments ?

Javascript, (compiled into HTML), will ! So no need to write code in APP format... as browsers can read HTML directly .

HTML is the code the WEB uses everywhere...

Best Wishes,

Steve.


User avatar
NormanDunbar
Aurora
Posts: 830
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: How do you make a QL emulator?

Postby NormanDunbar » Wed Feb 12, 2020 1:41 pm

Hi Steve,

Python will run on PCs under Windows or Linux, and on Macs, if and only if the Python environment is installed. On Linux it's pretty much already there (especially on Raspberry Pis). Windows needs a download from python.org. I have no idea what Apple's do! On Android tablets and Phones there is a Python interpreter that can be installed - https://play.google.com/store/apps/deta ... 3&hl=en_GB - I'm not sure if it has adverts though. It doesn't mention it.

Will Python code run under a Web interface, I don;t know. I suspect probably, but I tend not to bother with stuff in Web Pages, except for browsing to be honest. Try https://trinket.io/python whihc appears to do exactly that!

I agree that JavaScript runs under HTML - but not on my Tablet as I have disabled JavaScript unless I white list a web page. Too many bloody pop-ups when I'm using the tablet. The Linux browser had ad blockers installed which are probably filtering the JS out. At work, the language we use in the HTML browsers is not JavaScript, it's Java. Our developers - of which I am not one - create applications with Java, JDBC and the databases at the back end are Oracle. (That's my department!)


Cheers,
Norm.


Why do they put lightning conductors on churches?
If at first you don't succeed, don't take up skydiving!
If you think your job is pointless, remember, there's someone in Germany who fits indicators to BMWs.
User avatar
tofro
QL Wafer Drive
Posts: 1780
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: How do you make a QL emulator?

Postby tofro » Wed Feb 12, 2020 2:35 pm

Most modern applications that have a GUI that runs in the web browser follow a multi-tier architecture approach.

The apps our guys here develop usually have a front-end running in the web browser that consists of a whole bunch of css and Javascript. That front-end does nothing but drive the Ui, there's no business logic (and no powerful language like Java, for reasons of security) and generally, make the LEDs blink and the menus tick. This is where I see JavaScript's main domain, but you want to avoid it, if possible, again for security reasons. And even that JavaScript is normally not touched by the developer - It's well hidden in generic Ui toolsets.

That front-end talks to an application server that holds a middle tier, written in Java, with one instance per user session. This is where the business logic and more complicated stuff runs. This can be JS, Java, Python, whatever. You mainly chose Java for the main body of the application and use an interpreted language like Python or JavaScript for modules that need to be customizable and where there is no real requirement for general performance. Behind there, the flow can go through various other tiers (or "Microservices") that supply bits of the application logic and can be implemented in basically everything (which is mainly Java).

What you generally don't want is a heavyweight implementation that runs on the client side (i.e, in the end-user's browser or even the end-user's session on the Appserver)- no Java, no Python, the less fancy, the better. The more powerful that implementation is the longer load times you have to endure and the more potential security holes you open up.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
tofro
QL Wafer Drive
Posts: 1780
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: How do you make a QL emulator?

Postby tofro » Fri Feb 14, 2020 2:35 pm

Found this one (no offense meant :) )

choose-your-weapon.png


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
NormanDunbar
Aurora
Posts: 830
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: How do you make a QL emulator?

Postby NormanDunbar » Fri Feb 14, 2020 2:47 pm

:D :D :D :D :D


Why do they put lightning conductors on churches?
If at first you don't succeed, don't take up skydiving!
If you think your job is pointless, remember, there's someone in Germany who fits indicators to BMWs.
stevepoole
Trump Card
Posts: 225
Joined: Mon Nov 24, 2014 2:03 pm

Re: How do you make a QL emulator?

Postby stevepoole » Mon Feb 17, 2020 10:58 pm

Hi Norman, Tofro,

I see you guys seem to be obsessed with JavaScript being a security risk.
Most people seem to write their QL programs as open source... or at least like to share them with others.
Protecting programs is an expensive business, often with little return. Enryption is another way, fraught with pit-falls.

Python is OK for Python programmers. (QlL programmers seldom code in that language).
If all you want is to share a QL program you have written on any platform, Javascript is a great option. It is much easier to learn than C++ , where you have to emulate many Superbasic functions yourself !

There are transpilers for Python to Javascript. And from Atari, Amiga and VisualBasic too.
Javascript is not only natively multi-platform, but is also very much faster than Basic. (several hundred times faster...)
I transcode from SuperBasic to JavaScript, line by line, using Notepad ++. The only big problem is with superbasic's complex FOR lists, which take a lot of thinking to work around.
'QL' Javascript programs can be distributed as email attatchments, run by simply clicking on them. It is time for QL code to get out into the mainstream of PCs, tablets and smartphones.
But don't try prototyping in JavaScript, unles yoour logic is preconceived and perfect : Better forget trial and error testing.....
Steve.


User avatar
NormanDunbar
Aurora
Posts: 830
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: How do you make a QL emulator?

Postby NormanDunbar » Tue Feb 18, 2020 8:32 am

Hi Steve,

stevepoole wrote:Hi Norman, Tofro,
I see you guys seem to be obsessed with JavaScript being a security risk.


Umm, no, not me. I just like a good joke - I prefer bad ones to be honest - and that's all.

I don't "do" JavaScript as I can't get my head around it, but it has been the source of numerous/some/many security problems in the past - I have no idea about the present. Either way, I have it enabled on my laptop and disabled on my table due to the immense number of pop-ups offering me an extremely large penis (although they use a different word) or "3,523 married women are looking for sex in my area!" and many other "hard sell/scam" offers. None of which are anything to do with the web sites I'm attempting to use on my tablet. It may not be a security problem any more, I don;t know, but it's an effing pain in the backside. Sadly.

I'm not fond of C++ either, I prefer C but sometimes C++ does it better - if not a little slower - I use both at work and at home - use the best tool for the job. I doubt that many QL programmers use JavaScript on the QL though.

So, no offence intended to any JavaScriptees, and I pretty much hate all languages equally! :D


Cheers,
Norm.


Why do they put lightning conductors on churches?
If at first you don't succeed, don't take up skydiving!
If you think your job is pointless, remember, there's someone in Germany who fits indicators to BMWs.
User avatar
tofro
QL Wafer Drive
Posts: 1780
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: How do you make a QL emulator?

Postby tofro » Tue Feb 18, 2020 9:47 am

stevepoole wrote:Hi Norman, Tofro,

I see you guys seem to be obsessed with JavaScript being a security risk.


Nah. Just everything that runs in a browser is a potential security risk, because it can potentially inject code into your computer that you aren't even aware of.

I have no preference for any programming language, as long as it suits the job and is not Lisp :) .

I do, however, think that there will always be a bit of friction loss when porting (even machine-translating) between one and the other language. Admittedly, the performance of modern PCs really tends to forgive a lot here and raw speed is by far not as important any more as it used to be on the QL.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
NormanDunbar
Aurora
Posts: 830
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: How do you make a QL emulator?

Postby NormanDunbar » Tue Feb 18, 2020 10:23 pm

tofro wrote:I have no preference for any programming language, as long as it suits the job and is not Lisp :) .


+1 on Lisp. I once bought a book on Common Lisp. I never finished it.


Cheers,
Norm.


Why do they put lightning conductors on churches?
If at first you don't succeed, don't take up skydiving!
If you think your job is pointless, remember, there's someone in Germany who fits indicators to BMWs.
swensont
Forum Moderator
Posts: 162
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: How do you make a QL emulator?

Postby swensont » Wed Feb 19, 2020 5:39 am

> +1 on Lisp. I once bought a book on Common Lisp. I never finished it.

Back in college in my computer languages class we had to do some Lisp programming. I wrote a Lisp program that actually ran the first time. Scared the *** out of me. Stack oriented languages are hard (like FORTH, Lisp, Postscript, etc). Getting it right the first time not what I was expecting.

I also like to use the best tool for the job (and my skill level) be it SuperBasic, C, Perl, awk, Pascal, Fortran, assembly (z80 only), GLE, etc.

Tim



Who is online

Users browsing this forum: tofro and 1 guest