That is an example. Although with the number of Pi in the world it has a pretty much negligible effect on statistics like the TIOBE index.Pi & Python is another combination?
Oh no! What have I done?Never heard of WASM before, but after looking it up I think it could be interesting (in combination with C).
You are close but in the embedded IOT market it is actually more simple.
Close? I think we are saying the same thing. Thank you for expanding on what I meant by "platform" with respect to micro-controllers and IoT devices.You are close but in the embedded IOT market it is actually more simple.
We are certainly in agreement on the general platform dictates language hypothesis. As hand waving as it is.It does not matter how good or bad C is or what you think, if you want or need help from the MCU manufacturer you have no choice.
"PyBoard" which runs MicroPython.
Like I said, 'an outlier'. I don't think things like the PyBoard are driving the IoT tsunami going on just now."PyBoard" which runs MicroPython.
Looks like you agree with the hypothesis then.Most people are looking for that path of least effort. So, when someone has a C solution, that's what everyone else takes for themselves. If it were some other language they'd likely have taken that... It might be the worst language in the world for some things but, if someone already has a solution using it, that's what's going to get used.
Seriously, this looks scary cool! Had never heard of it. Thanks!Heater wrote: ↑Wed Jan 08, 2020 12:36 pmOh no! What have I done?
I have had success compiling computer intensive code in C++ to WASM and incorporating it into web pages where it is used from JS. It's very easy to compile C and C++ to WASM using enscripten https://emscripten.org. As easy as compiling normally with GCC or Clang.
While quite an achievement in longevity, there is a hollowness in the C ecosystem that makes it difficult for people who have become experts in C to fix bugs in the compilers and generally contribute to the improvement of the language as a whole: C is no longer self hosting.
Yes. I counted 37,345 C source files and 23,719 C++ source files in GCC 9.2ejolson wrote: ↑Thu Jan 09, 2020 6:08 amOn the other hand, when marveling at how well the GNU Compiler Collection and Clang/LLVM compilers work, one cannot help but notice that those systems are written in the C++ language. Some might claim there is little difference between C and C++, but if that were the case why was C++ used instead of C to create a C compiler?
One cannot really say that. C is only a language specification maintained by whatever ANSI committee. GCC and Clang/LLVM are examples of implementations of that standard. If you want a C compiler written in C I'm sure there are many. Tiny C for example: https://bellard.org/tcc/C is no longer self hosting.
It looks like GCC supports Go as well:Heater wrote: ↑Thu Jan 09, 2020 10:45 amIn fact there is Go compiler that uses LLVM https://blog.gopheracademy.com/advent-2 ... ir-and-go/
Code: Select all
file.go Go source code. file.d D source code.
Quote from the Tiny C website: "I am no longer working on TCC."
A C and C++ compiler (GCC).
It will be interesting to see if a new branch of GCC forms because of the issue to the vendors.gcc version 4.5.1 (XC16, Microchip v1.41) Build date: Sep 3 2019 (Microchip Technology)
I remember bootstrapping early versions of gcc using the vendor C compiler on 32-bit Sun SPARC.
A very good question.So what does one now need to compile a latest spec C compiler ?
Exactly.Actuality, it did take quite some time. Some 50 years or so from men toggling front panels to filling web pages, from hand crafting assembler code to python.
Perhaps not.What? Though I'm fairly aware of how an automobile works, should I also be able to build one?
Wow, TCC is doing very well. One man makes a compiler, hundreds of other guys spend thousands of man years and decades of elapsed time to make a compiler that is only 24 times faster!Sure, but a TCC compiled Tatami solution runs in just under 4 minutes whereas an optimized GCC one runs in under 10 seconds on a Pi4.
It depends on where one starts from and where one wants to end up. Everything is an incremental improvement or change from the previous so we could get where we are now from nothing, just as we got here now. Probably not in a weekend.
OOP as is mandated by C++ is a drop dead on many microcontrollers.
I guess it depends on how much OOP you want.OOP as is mandated by C++ is a drop dead on many microcontrollers.
OOP support adds major complexities the concept of the self pointer, virtual method table and object code and data blocks.
It is built around the concept of the code execution being relocatable in some way.
Me?On your large CPU you take for granted that you can execute code in RAM and branch or jump everywhere your whole OS Windows or Linux is built around it. You load your app into memory from hard drive and then execute it
Even if you don't use or want very much object-oriented programming, I suspect the difficulty is that a working C++ compiler needs to be able to create all those those data structures and objects, just in case, and this is not possible for certain classes of micro-controllers. Oh well, I read that people are working on adding a wrapper library to the Linux kernel that allows coding loadable modules in Rust.Heater wrote: ↑Fri Jan 10, 2020 2:30 amI guess it depends on how much OOP you want.
Some years ago I made a little C++ program that had a class and instantiated a bunch of objects from it, then did some simple processing on those objects. I made the equivalent in C using a struct and passing a pointer to the struct as the first parameter to the functions I had there.
I was expecting to demonstrate that the generated C++ code was about the same size as the C. To my surprise I found the generated C++ code was exactly the same, byte for byte, as the C!