3 ms·
I still think it would be interesting to do a COBOL / RPG IV compiler to WebAssembly. The decimal handling will probably be an issue, but I am pretty tempted t
by protomyth 11y ago
I still think it would be interesting to do a COBOL / RPG IV compiler to WebAssembly. The decimal handling will probably be an issue, but I am pretty tempted to give it a go when the WebAssembly stuff matures a bit.
- Kristine1975 11y agoDecimal handling shouldn't be too difficult. Use an integer of the appropriate size for storage and scale by 10^n where n is the number of decimal places. E.g. (my COBOL is a little rusty) price PIC 999V99 ... move 3.14 to price would result in the WebAssembly equivalent of price = 314 In other words: Use fixed-point arithmetic, but with base-10 instead of base-2.