Welcome, Guest. Please login or register.

Author Topic: Layers.library V45 on the aminet  (Read 128879 times)

Description:

0 Members and 12 Guests are viewing this topic.

Offline OlafS3

Re: Layers.library V45 on the aminet
« Reply #269 from previous page: September 15, 2014, 11:06:32 PM »
Quote from: Heiroglyph;773106
I'm not sure what will become of this work, but here's a sample. I'm having trouble getting a table to format right in here, so read if you can, sizes are in bytes.

These aren't cherrypicked, they're just the ones I've done and tested enough to feel confident in them working like the originals.

Code: [Select]

Command OS3.1 Mine AROS (Vision 2.7)
AddBuffers 444 356 2168
Break 432 504 3732
ChangeTaskPri 460 476 3096
DiskChange 312 248 2052
Lock 536 628 2788
MakeDir 464 364 2732
MakeLink 700 556 2528
Relabel 584 580 3312
SetClock 668 636 4840
SetDate 688 724 3212

Total 5,288 5,072 30,460



My first reaction was "who cares today for disk capacity" but then I thought a little and must admit that this is indeed important when you want to run it on classic hardware. Aros devs use PCs for development so stripping software down from 3 KB to 500 Byte has not a very high priority but if people want it in that direction it would be good if more people become involved. Of course you can replace most components so if you have reprogrammed something it could be used. But this is certainly a basic problem, many components certainly could be optimized.
 

Offline Heiroglyph

  • Hero Member
  • *****
  • Join Date: Jun 2010
  • Posts: 1100
    • Show only replies by Heiroglyph
Re: Layers.library V45 on the aminet
« Reply #270 on: September 15, 2014, 11:29:00 PM »
I think Thomas is right on the money about startup and C library code.

My guess is that there's about 2k of startup/clib code duplicated on each command, but it may also be gcc contributing.

Most of my changes involved using native methods that would be in ROM, doing my own startup (2-3 lines of C code, wouldn't work in x86 AROS) and using C that I knew would compile to better assembly.

IMHO it's more readable now and I fixed several bugs along the way. AROS AddBuffers for example won't work correctly on a real ROM, but this works on both back to v37 KS.

I had more of it done with SAS/C but switched to vbcc this weekend for c99 support and a better compiler.
« Last Edit: September 15, 2014, 11:34:15 PM by Heiroglyph »
 

Offline Heiroglyph

  • Hero Member
  • *****
  • Join Date: Jun 2010
  • Posts: 1100
    • Show only replies by Heiroglyph
Re: Layers.library V45 on the aminet
« Reply #271 on: September 15, 2014, 11:40:53 PM »
Quote from: OlafS3;773109
My first reaction was "who cares today for disk capacity" but then I thought a little and must admit that this is indeed important when you want to run it on classic hardware. Aros devs use PCs for development so stripping software down from 3 KB to 500 Byte has not a very high priority but if people want it in that direction it would be good if more people become involved. Of course you can replace most components so if you have reprogrammed something it could be used. But this is certainly a basic problem, many components certainly could be optimized.

Also when your disk access is measured in KB per second it's a lot more important than on a PC where 60MB per second isn't even considered fast.

Most of my time is still spent working out a good automated workflow for building and testing, but the code itself is pretty easy.

I'm hesitant to put this back into AROS though.  I'm using a compiler they don't want plus I don't have (or want) an x86 AROS development system and I refuse to check in code that I can't test.
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1150
    • Show only replies by Thorham
Re: Layers.library V45 on the aminet
« Reply #272 on: September 16, 2014, 12:21:15 AM »
Quote from: biggun;773097
The point is that if you write complex algorithms its a lot easier to keep the overview if you use a high level language.
Yes, higher level languages are easier for most things.

Quote from: Thomas Richter;773100
Look, have you ever done a complex project?
Not yet, but define complex, or better yet, give some concrete examples of what creates the kind of complexity that is so hard to manage in assembly language (for software that would run well on 68020/30).

Quote from: Thomas Richter;773100
You seem to say "everything is in assembler, so you can do everything in assembler in first place".
For anything that's worth implementing on 68020/30 certainly.

Quote from: Thomas Richter;773100
That's simply not correct.
It is. It simply depends on ones ability. Maybe I can't do it, maybe you can't do it, but that doesn't make it impossible.

Quote from: Thomas Richter;773100
If you do the same in assembly, you would need to re-adjust the objects, re-check the interfaces. register assignments, scratch-registers...
And how exactly is that a problem? What I see as the main problem is when you're changing things all the time. Tells me that you didn't think it through thoroughly enough, and we've all been there.

Quote from: Thomas Richter;773100
In other words, your daily work is so much tight up in low-level details that you are losing any type of control on the *real* work, and you're lost in problems usually not worth mentioning.
You can also try to get it mostly right from the start, so that you can focus on writing actual functional code. Anyone who's lost in the details all the time is simply doing it wrong.

Quote from: Thomas Richter;773100
Software engineering means using the right tools to get the job done as best as possible.
That's only one part of it, and it's not the most important one. True software engineering means that you don't write a single line of code until you have a proper design. Something that works, and won't break when you want to add or change things. It's this part that's the hard part, and it can make the actual implementation process almost seem trivial in comparison. That's why when you're changing a lot of things you're not doing it right. You shouldn't have to, except when designing the software.

Quote from: Thomas Richter;773100
Well, anyhow, just for the means of it, my offer was already that you probably start writing a JPEG 2000 from scratch from the specs in assembler.
Yes, but why JPEG 2000? I'd rather do something that's more interesting. Same for the MPEG decoder you suggested in the other thread. JPEG 2000 isn't widely used, and MPEG on 68020/30s isn't very useful. I suggested a new GUI system, but that's not complex enough. So the big question is what would be really worthwhile to do on 68020/30 that's also reasonably complex? An HTML/CSS engine maybe?

Quote from: Thomas Richter;773100
In the end, if you're lucky, you probably get something that works, but most likely because you have forced program structures together that are sub-optimal, without understanding that your selection of algorithms was more due to low-level ease of implementation than high-level analysis of the problem.
I don't pick algorithms just because they're easier to implement in assembly language. I look for algorithms that get the job done properly and efficiently, and if implementing them sucks, then it sucks and I do it anyway (or I don't because I'm lazy).

Quote from: Thomas Richter;773100
Professional software is something different than rewriting the "List" command in assembler.
I don't doubt it, but we're also not talking about ten million line programs here, we're talking about software that will run well on 68020/30s. Such constraints automatically limit the complexity of a project, because programs that are so huge and heavy won't run well on 68k anyway.
 

Offline kolla

Re: Layers.library V45 on the aminet
« Reply #273 on: September 16, 2014, 07:17:36 AM »
Quote from: Thomas Richter;773044
Then you will never be able to work in professional (as in: for money) software development.


Not true at all, there are plenty of jobs in open source development.
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: Layers.library V45 on the aminet
« Reply #274 on: September 16, 2014, 07:37:56 AM »
Quote from: Thorham;773112
Yes, higher level languages are easier for most things.

Not yet, but define complex, or better yet, give some concrete examples of what creates the kind of complexity that is so hard to manage in assembly language (for software that would run well on 68020/30).

For anything that's worth implementing on 68020/30 certainly.


I have an idea: write a web browser. Such thing can run reasonably well on 68020 and is always useful.

I dont mind if you skip development phase and disassemble existing IBrowse 2.4 and just add CSS support.
My Amigas: A500, Mac Mini and PowerBook
 

Offline Oldsmobile_Mike

Re: Layers.library V45 on the aminet
« Reply #275 on: September 16, 2014, 08:19:03 AM »
Quote from: itix;773124
I have an idea: write a web browser. Such thing can run reasonably well on 68020 and is always useful.

I dont mind if you skip development phase and disassemble existing IBrowse 2.4 and just add CSS support.

With the number of programmers that have already commented on this thread, if they pooled their talents and did it exactly as you said this would be cake. ;)  I was just using iBrowse a few minutes ago to snag some stuff off Aminet and check Google News.  It's amazing how well my A2000 holds up, sitting here next to my i7 PC.
Amiga 500: 2MB Chip|16MB Fast|30MHz 68030+68882|3.9|Indivision ECS|GVP A500HD+|Mechware card reader + 8GB CF|Cocolino|SCSI DVD-RAM
Amiga 2000: 2MB Chip|136MB Fast|50MHz 68060|3.9|Indivision ECS + GVP Spectrum|Mechware card reader + 8GB CF|AD516|X-Surf 100|RapidRoad|Cocolino|SCSI CD-RW
 Amiga videos and other misc. stuff at https://www.youtube.com/CompTechMike/videos
 

guest11527

  • Guest
Re: Layers.library V45 on the aminet
« Reply #276 on: September 16, 2014, 08:43:27 AM »
Quote from: Thorham;773112
It is. It simply depends on ones ability. Maybe I can't do it, maybe you can't do it, but that doesn't make it impossible.
Not really. It is a matter of available mental capacity. The more you invest into the low-level details, the less is left for the high-level structure. Take this as a fact that you only have a limited memory, limited overview, limited time. In other words, when writing assembly, you will be lost in detail, and loose the overview to the really important infrastructure decisions.
Quote from: Thorham;773112
And how exactly is that a problem? What I see as the main problem is when you're changing things all the time. Tells me that you didn't think it through thoroughly enough, and we've all been there.
What I hear from other developers, and what I have experienced myself is that you're continuously refactoring code. It sounds wasteful, but it is just the experience that, when designing the code, you made estimates on complexity, memory footprint, usage etc... that are typically not correct, tasks are ill-defined, the architecture is typically not fully designed... It is just a fact that nobody has a complete overview on the project when started, and the only way how to get an overview is to actually implement it. Then it's better not to waste time in implementing too much, but instead invest time in prototyping and testing, and later refine and improve the implementation as soon as you get a feeling where the complexity is.  
Quote from: Thorham;773112
You can also try to get it mostly right from the start, so that you can focus on writing actual functional code. Anyone who's lost in the details all the time is simply doing it wrong.
You haven't done any complex program, but let me tell you that you *never* get it right from the start. If you do it in assembler, you're at some point in the stage of "oh, the heck of it", and then you start to complete the program in the design you intended originally, knowing that the choices were not ideal. That's different if you work on a higher level - it is easier to change the code, and to throw code away, or to rewrite and adapt the code.  

Yes, you will be lost in detail in assembler - you're moving data from register dx to register an. That's detail, and it is a detail level that is not helpful to structure the problem.  
Quote from: Thorham;773112
That's only one part of it, and it's not the most important one. True software engineering means that you don't write a single line of code until you have a proper design. Something that works, and won't break when you want to add or change things. It's this part that's the hard part, and it can make the actual implementation process almost seem trivial in comparison. That's why when you're changing a lot of things you're not doing it right. You shouldn't have to, except when designing the software.
That's probably what management wants it to be (the "waterfall design"). Believe me, that's nonsense. It doesn't work this way, never did except for trivial programs. Ask other experienced developers. Software design means continuous refactoring, as the code grows, as the problem becomes defined better, as you learn more about the bottlenecks, as the customer learns more what he actually wants... Good programs have been written multiple times until they became good. But not too often, as then you're running in danger of the "second system design effect" (too complex, too much detail). Finding the right balance is the art.  
Quote from: Thorham;773112
Yes, but why JPEG 2000? I'd rather do something that's more interesting. Same for the MPEG decoder you suggested in the other thread. JPEG 2000 isn't widely used, and MPEG on 68020/30s isn't very useful. I suggested a new GUI system, but that's not complex enough. So the big question is what would be really worthwhile to do on 68020/30 that's also reasonably complex? An HTML/CSS engine maybe?
I picked it because that's were I first admired the benefits of high level languages. You can also try to write a HTML engine, but probably a javascript interpreter (or compiler) would be interesting. It doesn't really matter too much. As soon as the problem becomes big enough, and you need to coordinate with other partners or with other software, you'll run into trouble.    
Quote from: Thorham;773112
I don't pick algorithms just because they're easier to implement in assembly language. I look for algorithms that get the job done properly and efficiently, and if implementing them sucks, then it sucks and I do it anyway (or I don't because I'm lazy).
Complex software is more than an algorithm. It mean sticking lots of algorithms together to form a complete architecture, and you usually do not make the right choices for each of the algorithms when you start. Essentially, you can't, it's a chicken and egg problem. You don't have the full problem at your hands when you start (you never have, regardless what management says), you don't have the full data, so you depend on assumptions. Best guess is that these assumptions are usually wrong. Thus, you find yourself in the situation that you have to replace algorithms, put them together in a different way, or rethink your design. It is not unusual that several parts of such a project are dumped and rewritten because you learned more as the project proceeded. That's normal, and nothing to be afraid of.  
Quote from: Thorham;773112
I don't doubt it, but we're also not talking about ten million line programs here, we're talking about software that will run well on 68020/30s. Such constraints automatically limit the complexity of a project, because programs that are so huge and heavy won't run well on 68k anyway.

Why? Program size is only limited by your ability to use the right tools, not the CPU. Most complex programs do not even depend on "heavy work" for the CPU. It is just complex work. Running time does not correlate with program size.

To give you some ideas: The largest scale Amiga program I have written in assembler is ViNCed, which is about 63000 lines assembler. It is *barely* managable in that size. It's hard to change, and its hard to maintain.

The largest C program I wrote on the Amiga is probably VideoEasel, it's about 45000 lines of C and assembly, and even though it does a lot more than just a console and is more complex, it is easier to handle. Both work on the same hardware.

A large C++ program I wrote on *ix is the JPEG 2000 codec, in total about 250000 lines. Yes, it would compile on Amiga, and it is still in a state where it can be maintained. Yet, it is the fastest JPEG 2000 you'll find on the market. Not "despite it uses C++", but "because it uses C++". It would have been simply impossible to do that in assembler. Yes, there are assembler parts in it, but only where it matters. (The reason for the size is that it does a lot more than encoding and decoding of images. JPEG 2000 has multiple parts, and this specific implementation covers parts 1,2,3,9 and 12, and was the basis for many of the reference images in part 4.)

And once again, even this implementation is small compared to a full scale project, such as a web-browser, where a harmless image codec is just one of the many tiny details you need to fit together to make the whole thing work. Then you have products that built on top of web-browsers and java script, and projects that are built on top of java-script again... It's a full hierarchy of complexity. Of course, even if you have a java code, that is compiled into javascript, that is delivered over TCP/IP, that is compiled by a web-browser JIT compiler, that is run in the browser sandbox, it is all asssembler in the end. But only there, in the end. Nobody sane in his mind would develop such an application in assembler.

Or even different: If you as a human would have to think and coordinate every heart-beat, every breath and every mussle by your higher brain functions, you would get nuts. There are automatisms built into the lower areas into the brain that take all the complexity away, and that do that "automatically for you" to reduce the complexity, but that limits your control on these functions. For the better of your life.
 

Offline Cosmos Amiga

  • Hero Member
  • *****
  • Join Date: Jan 2007
  • Posts: 954
    • Show only replies by Cosmos Amiga
    • http://leblogdecosmos.blogspot.com
Re: Layers.library V45 on the aminet
« Reply #277 on: September 16, 2014, 09:37:35 AM »
Quote from: Thomas Richter;773131
The largest scale Amiga program I have written in assembler is ViNCed, which is about 63000 lines assembler. It is *barely* managable in that size. It's hard to change, and its hard to maintain

Because you are still a beginner in asm : you have a lot of thing to learn, and me too in other domains of course... We have all to learn all !!

You take your case for a generality... Big mistake !


The 68k is certainly the only CPU who large programms are fully possible in asm only...

For exemple, the W3D_Permedia2.library is 276 615 lines long and I make any changes very easly...

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1150
    • Show only replies by Thorham
Re: Layers.library V45 on the aminet
« Reply #278 on: September 16, 2014, 09:44:00 AM »
Quote from: Thomas Richter;773131
To give you some ideas: The largest scale Amiga program I have written in assembler is ViNCed, which is about 63000 lines assembler. It is *barely* managable in that size. It's hard to change, and its hard to maintain.
Would you let me take a look at the source code? Might help you get your point across if you're right ;)
 

Offline vxm

  • Jr. Member
  • **
  • Join Date: Apr 2012
  • Posts: 59
    • Show only replies by vxm
Re: Layers.library V45 on the aminet
« Reply #279 on: September 16, 2014, 10:39:28 AM »
I think I'll restart to program in machine language on punched cards.
 

guest11527

  • Guest
Re: Layers.library V45 on the aminet
« Reply #280 on: September 16, 2014, 10:52:11 AM »
Quote from: Cosmos;773136
Because you are still a beginner in asm : you have a lot of thing to learn, and me too in other domains of course... We have all to learn all !!

You must be kidding, right? I started with assembler, and moved for a reason. Actually, ViNCed is probably one of the older programs. Now that I read the copyright notes, it gives me the creeps. "© 1990-2001 THOR". Nine years of writing, rewriting, improvements, changes. This is version 3... I believe this makes >25 years of assembly experience, not counting the 6502-years.

Anyhow, you life, you learn... Why don't you start a larger project, for example?
 

Offline psxphill

Re: Layers.library V45 on the aminet
« Reply #281 on: September 16, 2014, 10:53:39 AM »
Quote from: Thomas Richter;773082
Anyhow, byte counting stopped making sense, already when 512K were the norm, and priorities changed.

It still made sense, if you needed the space. If you could shave a couple of K off and make something fit in ram or on disk then the cost saving was worthwhile.
 
 exec/dos/workbench etc that were in memory a lot of the time would make sense to be as efficient as possible. Not many people would complain if Prefs wasted 100k of ram.
 
 gnu 68k compilers are shockingly bad, it's one of the things that needs the most development.
 

Offline psxphill

Re: Layers.library V45 on the aminet
« Reply #282 on: September 16, 2014, 11:02:40 AM »
Quote from: Thorham;773096
That implies that it's not possible to always implement optimal algorithms in an optimal way in assembly language.

Sure it's possible, it's possible that you'll get it finished before you give up, it's possible there won't be any bugs, it's possible that when you realise there is a better algorithm that requires you to start again that you will actually do it.
 
 For most people it's very unlikely they'll bother.
 
 You are arguing over usage and interpretation of English, not of the actual issues at hand.
 
 It's impossible for me to write in assembler these days, not because I can't but because I won't let myself. Life is too short. If you can afford to waste the time then go ahead, but it doesn't prove what you think it does.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Layers.library V45 on the aminet
« Reply #283 on: September 16, 2014, 11:29:27 AM »
Quote from: Cosmos;773136
For exemple, the W3D_Permedia2.library is 276 615 lines long and I make any changes very easly...


There's an unreleased version of this library for OS3.x (the OS4 version is based on it). It's about 1/8th the size of the Warp3D 4.2 release version, fully supports every v4 array/element/index size primitive and is up to 2x faster at rendering triangle/strip/fan lists.

Those gains were from refactoring the C and then rewriting some vertex fetch routines in assembler. The latter did not give much gain since in the end the bus is the bottleneck.
int p; // A
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1150
    • Show only replies by Thorham
Re: Layers.library V45 on the aminet
« Reply #284 on: September 16, 2014, 12:01:51 PM »
Quote from: psxphill;773143
If you can afford to waste the time then go ahead
I've said this before: My hobby is NOT a waste of time to me. What's really a waste of time is having been an alcoholic for 14 years doing nothing useful at all. If I had spent all that time writing 68k software in assembly language, then I'd have quite a few nice pieces of software.

Doing what you like doing isn't a waste of time. You don't like assembly language? Great, don't use it, but don't say it's a waste of time just because it's a waste time to you. Some people like peanut butter and some don't. No sense in arguing about that.