WebAssembly progress

The path of least resistance is 3 ohms. Now can we get back to WebAssembly progress - #179 by SamuraiCrow ?

1 Like

Get it working under MacOS with Metrowerks C++ (mwcc/mwld) and this might actually be useful for BeOS PowerPC, (which basically uses those exact compilers, albeit a slightly older version.) You can build BeOS apps under Metrowerks IDE on Windows/Mac if the PowerPC compilers are installed. Message me if you want more info.

Let me get it working on systems I currently have. My G4 Mac Mini is running MorphOS exclusively. My G3-based MicroA1 runs AmigaOS4.1FE. Those are my only PowerPC machines.

I was tempted to make an AmigaOS 3.1, 4.1 and MorphOS build of the WASI library. Iā€™m keeping that on hold for now also. A BeBox would be such a collectible I doubt I could afford one even now.

If you already have a BeBox and Mac PPC, I can send you tarballed source and it should build easily. W2C2 is targetted at POSIX first, and not specifically Linux or BSD. The examples supplied work on big and little endian machines. I can send you build instructions that use GCC or Clang but the makefiles should be easily modified.

1 Like

Interesting indeed, network theory :thinking:
(I guess it will be 1 ohm, due to the parallel circuits)

Sorry for the off-topic reply, couldnā€™t resist :grin:

1 Like

@memsom The original author is working on a Classic Mac version using MetroWorks compiler and CodeWarrior IDE. Itā€™s in the macintosh branch on GitHub - turbolent/w2c2: Translates WebAssembly modules to C but note that my makefile pull request has barely been commented on so mind the extra step in the build process in the readme file.

Is this general enough to work on exotic machines, not quite the Deathstation 9000, but just somewhat more obscure machines. Does the generated code assume it is okay to compare pointers to two different objects, or to generate pointers which point more than one element past an array? Also, does it make assumptions about the width and representation of various integer types? Or try to fit pointers in some integer type and to convert the resulting integers back to pointers without data loss?

Just asking out of curiosity.

Clang can target WebAssembly if thatā€™s what you need to know regarding pointer arithmetic. As far as I know, the only missing header from ANSI/ISO C is setjmp.h and therefore, C++ exceptions also donā€™t work yet. The 32-bit version of WebAssembly can compile on 64-bit systems also so donā€™t take pointer sizes for granted.

Also, if you look at the W2C2 repo, it has WASI runtime packages for NextStep, WinXP, MacOS 9 and other old and exotic operating systems.

I was asking about machines on which int is 16 bits, or those that utilize oneā€™s complement (or even sign-magnitude) representation for signed integers, or machines with odd word sizes (i.e. 9 bit chars, 18 bit words, or 24 bit words), or machines where pointer arithmetic outside an object does not work (such as the IBM I), or machines on which NULL is not zero.

All of these machines are supported by Standard C.

If you can get your 16-bit system to stack 2 words together like a 68000 CPU then thatā€™s close enough to 32 bit. 24 bit addressing will work if it pads the addresses with an additional pad byte also. 9 bit bytes will likely not work. On memory protection schemes that donā€™t allow out-of-bounds memory accesses for structures, YMMV.

The question is whether or not the generated C code will work on systems on which int is 16 bits.

Ok. I think it requires a 32-bit CPU minimum.

Update Time

The W2C2 project is progressing nicely without much help from me. I had turned my attention to the standardization progress within the WASI standards body. It seems that they are almost to the point of having a command-line interfaced text-only application ā€œworldā€ for sections of standards that need to be implemented to do such a program. Previous examples used custom startup code, for example.

The Bad News

It seems that the standards are taking long enough to be implemented that they need accelerating. I donā€™t think I can make any contributions that will speed things up toward that end, however. The people working on it know what they are doing and standardization is a laborious task. I canā€™t move things forward more quickly and I canā€™t demonstrate anything wrong with whatā€™s going on in the industry. This has lead me to believe that I canā€™t contribute to this cause to the degree I had hoped.

In light of the fact that W2C2 is a good project that is chasing a moving target just as many similar projects Iā€™ve seen also do, I donā€™t know how to make things any better or faster. As such I am turning my attention away from this project for the time being.

I hope I can still find ways to contribute to the Haiku project in the future but I donā€™t know how. Thanks for reading my thread this long. Maybe I can figure out some way to contribute in the future.

6 Likes

2 posts were split to a new topic: Wifi problems