HNHacker News
TopNewBestAskShowJobs

pfusik

8 karma · joined October 9, 2021

submissionscomments
pfusik··on Ć Programming Language
Please show us real code where std::unique_ptr vs std::shared_ptr makes a considerable difference (with benchmarks). A pointer indirection causes a cache miss?

A shared_ptr can be optimized to unique_ptr if it's not copied.

Not sure what you mean by "a GC language". Most cito targets are garbage-collected.

pfusik··on Ć Programming Language
I do not expect anyone to code a C or C++ library with no awareness of memory errors. This isn't a safe language on top of C++. If you target C++, you need to know it.

On the other hand, if you only know "safe" languages and target "safe" languages, there will be no dangling references.

By POLA, Ć doesn't reinvent keywords (compare to Rust) and the translated code is meant to look "obvious" compared to what you wrote in Ć. It's not "knowledge of C# is sufficient to write code correct in eight other languages" (that would be quite astonishing actually).

pfusik··on Ć Programming Language
Let's discuss it in https://github.com/pfusik/cito/issues/30
pfusik··on Ć Programming Language
I'd like to rewrite cito to Ć at some point. One problem is that it's written in a fairly recent C#, so either Ć would need to catch up with two decades of C# development or the codebase be downgraded to an older language.

And we all use JavaScript NOT implemented in JavaScript. ;)

pfusik··on Ć Programming Language
No. As much as I love LINQ in C#, I don't see it easily translating to all the target languages.
pfusik··on Ć Programming Language
Yes, benchmarking is interesting. I will post benchmarks of different target languages.
pfusik··on Ć Programming Language
> Are there any samples of the final sources?

https://github.com/pfusik/cito/issues/21

I generally check-in just the Ć source and not the translations, but if you want a quick look at the generated C code, here's some: https://sourceforge.net/p/asap/code/ci/master/tree/asap.c

> if there's a error/bug in the generated code am I actually going to debug and parse it effectively? Generated code may be "readable" but it is it understandable?

I had no problems with that so far. Nim adds a lot of boilerplate code in C output. cito sometimes adds a few lines here and there, but mostly it looks like the code you would write directly.

pfusik··on Ć Programming Language
Yes, you can make a memory leak when targetting C, C++ and Swift. Same as when you code in C, C++ and Swift directly.
pfusik··on Ć Programming Language
There are still many Windows programs that default to current Code Page instead of UTF-8. I prefer to have the encoding explicit in the file contents rather than rely on some external file type configuration.

This is just a loose recommendation, cito does accept files without the BOM.