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

2024-07-10 Thread kiboshimo via Digitalmars-d-learn
On Wednesday, 10 July 2024 at 08:26:56 UTC, kiboshimo wrote: It would take sometime for me to figure how to print to javascript console from a generated .html file from emscripten, this is a small update so nobody gets too caught up that quote. Got it printing quicker than I thought (node and

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

2024-07-10 Thread kiboshimo via Digitalmars-d-learn
On Wednesday, 10 July 2024 at 01:48:54 UTC, kiboshimo wrote: - I though one could write an application with -betterC for WASM, because LDC can target it, then could build it linking to C libraries that already work on WASM and run the resulting build on the browser. That would avoid the JS-WASM

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

2024-07-09 Thread kiboshimo via Digitalmars-d-learn
On Tuesday, 9 July 2024 at 20:24:14 UTC, H. S. Teoh wrote: What are you planning to run your wasm on? If in the browser, you could just use the browser's JS math functions. The performance won't be stellar (the wasm-JS boundary is SLOW), but it'd work and you wouldn't have to write your own m

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

2024-07-09 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 09/07/2024 9:58 PM, kiboshimo wrote: On Tuesday, 9 July 2024 at 09:30:18 UTC, Richard (Rikki) Andrew Cattermole wrote: Threads are indeed gone. Oh no. If you want them, you'll have to call out to the system API and do your own thing. I hope "doing my own thing here" could be linking to

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

2024-07-09 Thread monkyyy via Digitalmars-d-learn
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 e

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

2024-07-09 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jul 09, 2024 at 08:03:15PM +, kiboshimo via Digitalmars-d-learn 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: [...] > > > Really liked the idea of doing it with betterC to start my systems > > > programmin

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

2024-07-09 Thread kiboshimo via Digitalmars-d-learn
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

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

2024-07-09 Thread kiboshimo via Digitalmars-d-learn
On Tuesday, 9 July 2024 at 14:38:34 UTC, Lance Bachmeier wrote: If you haven't done so, I'd recommend reading the blog posts from Walter to get an understanding of why BetterC was introduced and how to use it: https://dlang.org/blog/category/betterc/ - betterC does not need glue code to inter

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

2024-07-09 Thread monkyyy via Digitalmars-d-learn
On Tuesday, 9 July 2024 at 07:54:12 UTC, kiboshimo wrote: I'm going to try a project with raylib and WASM. use mine https://github.com/crazymonkyyy/raylib-2024/blob/master/docs/examplecode.md - betterC can be compiled to WASM, but some of phobos can't, so basically same worries as above. I'm

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

2024-07-09 Thread Lance Bachmeier via Digitalmars-d-learn
On Tuesday, 9 July 2024 at 07:54:12 UTC, kiboshimo wrote: If you haven't done so, I'd recommend reading the blog posts from Walter to get an understanding of why BetterC was introduced and how to use it: https://dlang.org/blog/category/betterc/ - betterC does not need glue code to interop wit

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

2024-07-09 Thread kiboshimo via Digitalmars-d-learn
On Tuesday, 9 July 2024 at 09:42:01 UTC, Sergey wrote: Feel free to join our Discord chat. Some info is saved there. Also many active authors of D libraries (including related to the betterC and WASM) are there as well Already did, will try the search bar later. Sun is rising over here and I

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

2024-07-09 Thread kiboshimo via Digitalmars-d-learn
On Tuesday, 9 July 2024 at 09:30:18 UTC, Richard (Rikki) Andrew Cattermole wrote: Threads are indeed gone. Oh no. If you want them, you'll have to call out to the system API and do your own thing. I hope "doing my own thing here" could be linking to a C library that interacts with the OS o

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

2024-07-09 Thread Sergey via Digitalmars-d-learn
On Tuesday, 9 July 2024 at 09:27:30 UTC, kiboshimo wrote: That's betterC targeting native. What about WASM? Does LDC -> WASM pipeline supports functionality one needs in a C-level language? If not, aside from atomics, one should be able to use C libraries to supplant any other purpose, right? S

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

2024-07-09 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 09/07/2024 9:27 PM, kiboshimo wrote: Based on the responses I'm assuming my example of atomic is a special case, but I shouldn't worry about low level things like threads to be absent all the same. Threads are indeed gone. That is library code in druntime that needs to be linked in along w

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

2024-07-09 Thread kiboshimo via Digitalmars-d-learn
Thank you for the comprehensive responses On 09/07/2024 8:43 PM, Richard (Rikki) Andrew Cattermole wrote: Atomics are provided by the compiler in the form of intrinsics. If you do not do this, they cannot be inlined as you're forced to use inline assembly. LDC and GDC like GCC and clang have

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

2024-07-09 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 09/07/2024 8:43 PM, evilrat wrote: - If your C/C++ library provides atomics, you can do this, but probably you can use some of the phobos as this is pretty low level stuff. Atomics are provided by the compiler in the form of intrinsics. If you do not do this, they cannot be inlined as you'r

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

2024-07-09 Thread evilrat via Digitalmars-d-learn
On Tuesday, 9 July 2024 at 07:54:12 UTC, kiboshimo wrote: Hi, Some stuff must look obvious to an experienced programmer so they are not explicit on articles and documentation over the internet. I'm somewhat inexperienced, so: - betterC does not need glue code to interop with C. Does it achi

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

2024-07-09 Thread kiboshimo via Digitalmars-d-learn
Hi, Some stuff must look obvious to an experienced programmer so they are not explicit on articles and documentation over the internet. I'm somewhat inexperienced, so: - betterC does not need glue code to interop with C. Does it achieve this by "gluing" behind the scenes? I've read in a com