English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Amiga scene (http://eab.abime.net/forumdisplay.php?f=2)
-   -   Python for Amiga ? (http://eab.abime.net/showthread.php?t=35997)

malko 04 November 2019 21:32

Quote:

Originally Posted by Gorf (Post 1356605)
Did you write an assembler version of your startup-sequence?
Quote:

Originally Posted by meynaf (Post 1356616)
No, but i could if i wanted to.
Did you write a python version of your startup-sequence ?


asm VS python : I bet on meynaf ;)

Gorf 04 November 2019 21:44

Quote:

Originally Posted by meynaf (Post 1356616)
It doesn't include my fave language (i code 020+, not bare 68000).
And it probably does not allow using own libraries.
So no, it hasn't been done before.

They allow off kinds of "runtimes", so I guess your own libraries would qualify as such.
Put your examples up!;)

Quote:

And how does a language qualify for being "appropriate" ?
Allowing me to solve the task in an easy and reproducible way.
Depending on the task it is often more important to archive a results fast, that archiving a fast result ... even if this means bloat.
I am no fan and compared to most colleges my code is still dense and efficient ... but I have no problem using all kinds of sugar if it makes my life easier.

Quote:

The problem with languages such as python is mainly that you often have to use libraries rather than built-in stuff and when these don't support what you want to do, you just scream.
screaming does not help ... in most cases ..
And often enough I had to implement my own libraries or hack others to provide the functionality needed.

But in a working environment the code needs to stay manageable by others than myself ... so it is preferred to use what is already there.

Quote:

There are lots of possible tasks, if you really want me to suggest some.
Show an IFF image ?
Lib/chunk.py
Quote:

Play a Protracker module ?
libxmplite

Quote:

Execute some custom bytecode ?
https://access.redhat.com/documentat...ng_Python.html

Quote:

Do some file format conversion ?
convertapi-python

Quote:

Or perhaps something simpler, like a custom atoi() function ?
myatoi = atoi(s[,base])



Quote:

Quote:

Did you write an assembler version of your startup-sequence?
No, but i could if i wanted to.
Did you write a python version of your startup-sequence ?
I could, but it would not execute since it lacks proper system integration.

But even if it did: it would not be the appropriate tool for the task.

Gorf 04 November 2019 22:13

Quote:

Originally Posted by malko (Post 1356618)
Quote:

Quote:

Did you write an assembler version of your startup-sequence?
No, but i could if i wanted to.
Did you write a python version of your startup-sequence ?
asm VS python : I bet on meynaf ;)

me too! :D

But both things would be impractical - that is the point I was trying to make!

chb 04 November 2019 22:47

Quote:

Originally Posted by malko (Post 1356618)
asm VS python : I bet on meynaf ;)

Code:

set;print """
MakeDir RAM:ENV
Assign >NIL: ENV: RAM:ENV
LoadWB
EndCLI >NIL;"""

:D:D:D
(should work with WB 2.1 and above)

Quote:

Originally Posted by Gorf (Post 1356627)
But both things would be impractical - that is the point I was trying to make!

I totally agree!

grelbfarlk 04 November 2019 22:50

I have an opinion that I must express. On the internet! I built Python for WarpUP for GemRB and it actually runs pretty well. The slow part is actually the non Python stuff, or maybe it's the Python stuff calling the non-Python stuff. Anyway the GUI is reasonably fast and that's all Python. So, that's the end of my story. In summary, Python is a language of contrasts.

Daedalus 04 November 2019 23:06

As an aside, Python is included with OS4, and it includes an arexx module that lets Python scripts do ARexx-specific things, like sending messages, opening ARexx host ports etc. It's quite neat, and would be nice to see backported to 68k. Also included are amiga, asl, catalog, icon and installer modules that together offer a reasonable level of system integration.

Gorf 04 November 2019 23:38

Quote:

Originally Posted by Daedalus (Post 1356641)
As an aside, Python is included with OS4, and it includes an arexx module that lets Python scripts do ARexx-specific things, like sending messages, opening ARexx host ports etc. It's quite neat, and would be nice to see backported to 68k. Also included are amiga, asl, catalog, icon and installer modules that together offer a reasonable level of system integration.

Add ‚ÄěLupa" to it - a Lua implementation in Python, and we are complete:
https://github.com/scoder/lupa

idrougge 05 November 2019 00:30

Quote:

Originally Posted by Gorf (Post 1356462)
Python is by no means "shit". It is a beautiful language.
And with Cython it can be fast!

But it lacks system integration for AmigaOS and the constant development and changes make it very hard to adapt these things to a new environment.

Maybe MicroPhython would be a good candidate for a 3.x based AmigaPython...
https://micropython.org

An other approach would be "StacklessPython", that might be a good fit for Exec (with some adaptions):

https://github.com/stackless-dev/stackless/wiki

The Amiga already has a standard scripting language with proper system integration. Use that instead of trying to contort Python into even compiling on AmigaOS.

Gorf 05 November 2019 01:08

Quote:

Originally Posted by idrougge (Post 1356658)
The Amiga already has a standard scripting language with proper system integration. Use that instead of trying to contort Python into even compiling on AmigaOS.

This thread is about Python for AmigaOS.
There can be more than just one programming language.

If you read the posts in this thread, you will realize, that Python is already compiling and running on AmigaOS - a outdated version on 3.x a more up to date version on 4.x

Please stop telling people what software they must use or wish for.

grelbfarlk 05 November 2019 01:29

Quote:

Originally Posted by Gorf (Post 1356662)
This thread is about Python for AmigaOS.
There can be more than just one programming language.

If you read the posts in this thread, you will realize, that Python is already compiling and running on AmigaOS - a outdated version on 3.x a more up to date version on 4.x

And a 2.7.1 version for WarpUP on AmigaOS 3.x which really isn't that old. Really it wasn't that hard to do, with some competent effort getting it finished should only take 2 weeks.

Bruce Abbott 05 November 2019 05:15

Quote:

Originally Posted by grelbfarlk (Post 1356664)
And a 2.7.1 version for WarpUP on AmigaOS 3.x which really isn't that old.

It's ancient.

Quote:

Really it wasn't that hard to do, with some competent effort getting it finished should only take 2 weeks.
So why don't we have it already?

IanS 05 November 2019 06:18

Quote:

Originally Posted by Bruce Abbott (Post 1356681)
It's ancient.

So why don't we have it already?

It's actually not that old, and compared to Amiga OS it's brand new.

We don't have these things because it takes time and effort. And at the end of it, all they get is crap from people like you and meynaf saying how crap it is, and how it's a waste of time. Apparently, if you don't like it, it can't be good for anyone else either. :nuts

jotd 05 November 2019 07:24

Quote:

The Amiga already has a standard scripting language with proper system integration. Use that instead of trying to contort Python into even compiling on AmigaOS.
Same for Windows with .bat. One of the main reasons I'm using python on Windows :)

I use 68k asm, C++, C, python, with a good level of expertise (check my Stackoverflow profile to see what I'm talking about), and they all complete nicely each other.

meynaf 05 November 2019 09:35

Quote:

Originally Posted by Gorf (Post 1356620)
They allow off kinds of "runtimes", so I guess your own libraries would qualify as such.
Put your examples up!;)

I doubt they use not standard runtimes, and if they do, there is still the host OS to be discussed.
And even if they did have AOS support here, they still don't have 68020+ category.
Are you afraid to show your Python skills, that you rely on others ?
This thread isn't the place to do this. But if i open new thread with a concrete example, will you come in and show working code ?


Quote:

Originally Posted by Gorf (Post 1356620)
Allowing me to solve the task in an easy and reproducible way.
Depending on the task it is often more important to archive a results fast, that archiving a fast result ... even if this means bloat.
I am no fan and compared to most colleges my code is still dense and efficient ... but I have no problem using all kinds of sugar if it makes my life easier.

Yes but this is the job of programmers, having to cope with everchanging specs, marketing people negociating impossible delays, and customers who don't know what they want. It's not really the point here.


Quote:

Originally Posted by Gorf (Post 1356620)
screaming does not help ... in most cases ..
And often enough I had to implement my own libraries or hack others to provide the functionality needed.

But in a working environment the code needs to stay manageable by others than myself ... so it is preferred to use what is already there.

Again, this has nothing to do with programming on the Amiga.


Quote:

Originally Posted by Gorf (Post 1356620)
Lib/chunk.py

This is only for reading chunks. It will not display the image.


Quote:

Originally Posted by Gorf (Post 1356620)
libxmplite

libxmp does not play all mods properly. So you will think it did the job and some user will reports his mods don't play right. Result : miserable failure, as there is nothing you can do about it.


Quote:

Originally Posted by Gorf (Post 1356620)

You are confusing virtualization and custom bytecode.


Quote:

Originally Posted by Gorf (Post 1356620)
convertapi-python

Only for standard conversions. If you have custom work to do on files, you have to do it yourself and this is what my example was about.


Quote:

Originally Posted by Gorf (Post 1356620)
myatoi = atoi(s[,base])

Which does not return updated value of "s" to point on next non-numeric character, nor detects if "myatoi" doesn't overflow, nor detects if "s" isn't a number at all.


Quote:

Originally Posted by Gorf (Post 1356620)
I could, but it would not execute since it lacks proper system integration.

But even if it did: it would not be the appropriate tool for the task.

Right.
And during that time, i could just start single asm-written command in startup-sequence. Ok, it still needs very small script to run it - so i could eventually place the code in custom kickstart to actually replace said startup-sequence...


Quote:

Originally Posted by Gorf (Post 1356627)
But both things would be impractical - that is the point I was trying to make!

You did not look like if you were trying to make this point. You were just saying one of the two things would be impractical, (carefully ?) forgetting to mention the other also would.


Quote:

Originally Posted by IanS (Post 1356685)
We don't have these things because it takes time and effort. And at the end of it, all they get is crap from people like you and meynaf saying how crap it is, and how it's a waste of time. Apparently, if you don't like it, it can't be good for anyone else either. :nuts

But it's rather the other way around. If YOU like it, then it must be good for everyone ?
And now if i just emit some small criticism, i get charged of emitting crap in return... :sad
My point was just to say python isn't any better than the others.


Quote:

Originally Posted by jotd (Post 1356690)
Same for Windows with .bat. One of the main reasons I'm using python on Windows :)

On windows it makes sense, because what's there at first place sucks.
But on Amiga ?

Anubis 05 November 2019 12:15

:lol you told me I am emotionally involved here?! Look at you friend...

Let's hope your are just trolling...

It would be great to have newer version of Python on AmigaOS.

meynaf 05 November 2019 13:20

Quote:

Originally Posted by Anubis (Post 1356734)
:lol you told me I am emotionally involved here?! Look at you friend...

Let's hope your are just trolling...

Read back to the first page. I didn't write anything aggressive and you charged me of trolling. Facts speak against you.

Anubis 05 November 2019 13:56

Reading first page - question does python exist for Amiga OS, many years ago - people said it does, not new version, tho.

I've already said - you are entitled to your own opinion. (no matter how wrong it is)

As I have already pointed in previous posts, Python is used by many universities and organizations and is language of choice to teach kids about programming today. I also pointed to class by one of best technical research universities that is using Python and teaching introduction to programming by use of python.

Now read your response...

How did you response to this? Python is shit??

If not trolling, tell me what your response is. Why?

gimbal 05 November 2019 14:12

A typical case of iterating too long on a done deal.

Gorf 05 November 2019 14:18

Quote:

Originally Posted by meynaf (Post 1356701)
I doubt they use not standard runtimes, and if they do, there is still the host OS to be discussed.
And even if they did have AOS support here, they still don't have 68020+ category.
Are you afraid to show your Python skills, that you rely on others ?
This thread isn't the place to do this. But if i open new thread with a concrete example, will you come in and show working code ?

It I look at your comments below, you would not accept anything I do.
So this would be rather futile.

Quote:

Yes but this is the job of programmers, having to cope with everchanging specs, marketing people negociating impossible delays, and customers who don't know what they want. It's not really the point here.
it is part of the point, as languages like Python can make things easier.

Quote:

Again, this has nothing to do with programming on the Amiga.
because you say so?

Quote:

This is only for reading chunks. It will not display the image.
You asked for IFF, which is only the container.

For ILBM you would read the chunks, convert the data and probably your pythons image library "pillow", to display it...

To de-interlieve the image on an classic Amiga might be stupid, so the smarter way would be to get amiga datatypes working on Python and let the system do the job.

You could also try to write the bitplane data directly into chip-ram ... Barry Walker has put up some examples for direct memory access with python for amiga in Aminet.

While all this is possible and Python more powerful and flexibel than AREXX this is NOT the typical use-case, but something, you do ONCE, as part of the system-integration.

usually a user would later just do:
"from Amiga-System import ILBM"

Quote:

libxmp does not play all mods properly. So you will think it did the job and some user will reports his mods don't play right. Result : miserable failure, as there is nothing you can do about it.
it is open source:
https://github.com/cmatsuoka/libxmp

If it does not work for you, why didn't you fix it?


Quote:

You are confusing virtualization and custom bytecode.
It sets up a VM that executes bytecode.


But probably that is more to your liking .. (or not, since I don't seem to understand what you re aiming at...)

https://csl.name/post/vm/

Quote:

Only for standard conversions. If you have custom work to do on files, you have to do it yourself and this is what my example was about.
was it?
Or is it just now about it?

You seem to move the target around as soon as I am getting close...

Quote:

Which does not return updated value of "s" to point on next non-numeric character, nor detects if "myatoi" doesn't overflow, nor detects if "s" isn't a number at all.
again: you did not ask for that specifics

(I really do not see the point in all that ...)

Quote:

Right.
And during that time, i could just start single asm-written command in startup-sequence. Ok, it still needs very small script to run it - so i could eventually place the code in custom kickstart to actually replace said startup-sequence...
sure - but that is not very flexible, so you will probably never do it.

That is the point: assembler is here the wrong tool form the job, and a shell-script is doing just fine.

Also scripting languages like AREXX and Python do have its place and that is why many people use them for fitting tasks.

Quote:

You did not look like if you were trying to make this point. You were just saying one of the two things would be impractical, (carefully ?) forgetting to mention the other also would.
nope - I did not.

Quote:

But it's rather the other way around. If YOU like it, then it must be good for everyone ?
Nobody was trying to force it on you.
You did post in a thread called "Python for Amiga" and started criticizing it.

Quote:

And now if i just emit some small criticism, i get charged of emitting crap in return... :sad
My point was just to say python isn't any better than the others.
still think it is much better than "brainfuck" (and probably many others)


Quote:

On windows it makes sense, because what's there at first place sucks.
But on Amiga ?
AREXX has its quirks and limitations and someone might prefer Python or Lua.

As others prefer C or AMOS over Assembler.

meynaf 05 November 2019 15:07

Quote:

Originally Posted by Anubis (Post 1356753)
Reading first page - question does python exist for Amiga OS, many years ago - people said it does, not new version, tho.

Question answered long ago and now we're OT. Perhaps this should just stop right here.


Quote:

Originally Posted by Anubis (Post 1356753)
I've already said - you are entitled to your own opinion. (no matter how wrong it is)

I especially like the "no matter how wrong it is". :rolleyes


Quote:

Originally Posted by Anubis (Post 1356753)
As I have already pointed in previous posts, Python is used by many universities and organizations and is language of choice to teach kids about programming today. I also pointed to class by one of most technical research universities that is using Python and teaching introduction to programming by use of python.

Wait a minute. Isn't this called "argumentum ad populum" ?


Quote:

Originally Posted by Anubis (Post 1356753)
Now read your response...

How did you response to this? Python is shit??

My response clearly wasn't "Python is shit".
However, yours was "Holly shit, how did we miss this ridiculous statement..."


Quote:

Originally Posted by Anubis (Post 1356753)
If not trolling, tell me what your response is. Why?

My response is available at post #20. Read again.


Quote:

Originally Posted by Gorf (Post 1356755)
It I look at your comments below, you would not accept anything I do.
So this would be rather futile.

Your replies were just choosing some lib that remotely looks as if it could do the work...
So i had to be a little more specific.
If we decide to really start the code contest, the rules should be as clear as possible, but why should they be fully specified now as it's likely that nothing will be done ?


Quote:

Originally Posted by Gorf (Post 1356755)
it is part of the point, as languages like Python can make things easier.

This thread is "python on amiga", not "python at work".


Quote:

Originally Posted by Gorf (Post 1356755)
because you say so?

No, because it is the thread's topic.


Quote:

Originally Posted by Gorf (Post 1356755)
You asked for IFF, which is only the container.

I wrote "iff image", which was assumed to mean ilbm.


Quote:

Originally Posted by Gorf (Post 1356755)
For ILBM you would read the chunks, convert the data and probably your pythons image library "pillow", to display it...

To de-interlieve the image on an classic Amiga might be stupid, so the smarter way would be to get amiga datatypes working on Python and let the system do the job.

You could also try to write the bitplane data directly into chip-ram ... Barry Walker has put up some examples for direct memory access with python for amiga in Aminet.

While all this is possible and Python more powerful and flexibel than AREXX this is NOT the typical use-case, but something, you do ONCE, as part of the system-integration.

usually a user would later just do:
"from Amiga-System import ILBM"

I'd really like to see actual code doing that.

But the situation isn't different with asm (on which it's very easy for me to load and show an iff file due to my existing loading routine), maybe 'xcept on one point : Amiga asm isn't a moving target. It will hardly ever change.
So maybe writing a routine for some task may take longer (NOT for that one, though).
But it will also last longer. A routine for life, instead of a routine that will have compatibility problems when next major version of the language comes out.
What happened to python 2.x programs already when 3.x came out ?


Quote:

Originally Posted by Gorf (Post 1356755)
it is open source:
https://github.com/cmatsuoka/libxmp

If it does not work for you, why didn't you fix it?

So now i must be doing YOUR work ? Remember, it's YOU who said this lib would do the job !
For me it's a lot easier to use some asm replay routine...


Quote:

Originally Posted by Gorf (Post 1356755)
It sets up a VM that executes bytecode.


But probably that is more to your liking .. (or not, since I don't seem to understand what you re aiming at...)

https://csl.name/post/vm/

It's indeed closer. And now, by having seen it, it looks simpler to actually do that in asm.
I'm not aiming at something specific.


Quote:

Originally Posted by Gorf (Post 1356755)
was it?
Or is it just now about it?

You seem to move the target around as soon as I am getting close...

The target wasn't supposed to be clearly defined to start with...
It was just raw idea, and then instead of simply choosing one you throw library names.
What should i have done about it ?


Quote:

Originally Posted by Gorf (Post 1356755)
again: you did not ask for that specifics

(I really do not see the point in all that ...)

And again, it wasn't supposed to be fully defined either. I just had to be more specific to prevent you from just throwing in some existing function.
Anyway, this was just what my actual asm routine provides...


Quote:

Originally Posted by Gorf (Post 1356755)
sure - but that is not very flexible, so you will probably never do it.

That is the point: assembler is here the wrong tool form the job, and a shell-script is doing just fine.

Also scripting languages like AREXX and Python do have its place and that is why many people use them for fitting tasks.

It was about saying that while both tools are inappropriate for the task, one is less inappropriate than the other.


Quote:

Originally Posted by Gorf (Post 1356755)
nope - I did not.

These things can be made unintentionnally.


Quote:

Originally Posted by Gorf (Post 1356755)
Nobody was trying to force it on you.
You did post in a thread called "Python for Amiga" and started criticizing it.

And now criticizing is forbidden so i should just stop ?


Quote:

Originally Posted by Gorf (Post 1356755)
still think it is much better than "brainfuck" (and probably many others)

Since when being better than the worse means being good ?


Quote:

Originally Posted by Gorf (Post 1356755)
AREXX has its quirks and limitations and someone might prefer Python or Lua.

As others prefer C or AMOS over Assembler.

Every language has its warts.
But replacing arexx by python or lua isn't very clever for the simple reason they don't have built-in port to send commands to other programs.
Arexx also does not have big runtime.
Anyway, the point was - once again - it is here all about python on amiga, not python on windows or at work.


All times are GMT +2. The time now is 13:27.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.

Page generated in 0.06416 seconds with 11 queries