Being reading a lot about betterC, but still have some questions

monkyyy crazymonkyyy at gmail.com
Tue Jul 9 20:54:41 UTC 2024


On Tuesday, 9 July 2024 at 20:03:15 UTC, kiboshimo wrote:
> On Tuesday, 9 July 2024 at 14:42:01 UTC, monkyyy wrote:
>> On Tuesday, 9 July 2024 at 07:54:12 UTC, kiboshimo wrote:
>>> - betterC can be compiled to WASM, but some of phobos can't, 
>>> so basically same worries as above. I'm afraid to lose some 
>>> essential systems stuff that I could not replace.
>>
>> yes, and your not afraid enough
>>
>>> Really liked the idea of doing it with betterC to start my 
>>> systems programming journey
>>
>> Theres nothing even slightly pleasant or easy about d's wasm 
>> "support"; I wrote my own cos, sqrt functions, you get 
>> *nothing* from phoboes
>
> Writing my own math functions is outside of my range, I still 
> have hopes of this not being so hard. So you get another 
> opportunity to crush it.

Honestly porting isqrt is easier then trying to get a half baked 
file io to work

but it is *everything* is gone and thats probaly overwhelming 
unless your prepared for it.

>
> You could have used a C library for those things you 
> implemented yourself, right? I suppose you didn't because doing 
> things is cool, or because C is "not ergonomic" to use as 
> foreign code. Because of the quirks. Which would make for a not 
> so pleasant experience when writing a small game.
>
> What do you think about using C libraries like that?

wasm *in general* breaks libc's fileio "for safety" (arguably the 
most important part of libc, morons), d's wasm libc in even more 
broken due to it coming out of no where and there being like 3 
guys doing 20 ours of work on the "runtime" or something(ignore 
ppl who say d supports 7 platforms, it supports 2).

While it can be a trivial port, I think you better off sticking 
to the raylib api as your ground layer as whatever work there 
seems to carry over.


More information about the Digitalmars-d-learn mailing list