objeck / objeck-lang

Objeck is a modern object-oriented programming language with functional features tailored for machine learning. It emphasizes expression, simplicity, portability, and scalability. The programming environment consists of a compiler, virtual machine, REPL shell, and command line debugger with IDE plugins.
https://objeck.org
Other
154 stars 11 forks source link

Strings to be UTF-16 on all platforms? #481

Closed ghost closed 6 months ago

ghost commented 6 months ago

This is not a feature request. This is only a discussion for fun. I just found out that .NET strings are UTF-16 regardless of platforms. The same thing is true for Java, too. To do this, the .NET guys have to use the library ICU on Linux. They are now using char16_t instead of wchar_t. Recently, they decided to use the library ICU on Windows, too. So, they no longer use the Windows API for text encoding. Library ICU is modeled after Java's text encoding. The JVM guys also introduced a modified UTF-8 text encoding for their internal use within the JVM. The reason .NET and Java use UTF-16 and are stuck with it is because they are one of the early adopters of Unicode. It turned out that UTF-16 stinks, and the world is now embracing UTF-8.

The reason Objeck used wchar_t from the beginning was because of the influences of Java, wasn't it? Between going to UTF-16 for all platforms and switching to UTF-8 for all platforms, do you think which is more doable?

objeck commented 6 months ago

Objeck initially used char for strings, which was appropriate for its 32-bit targets year ago. The code was refactored to support wchar_t and legacy conversions between the types. It's worth noting that UTF-8 is a standard I/O exchange format, and I have no plans to change that in Objeck.

ghost commented 6 months ago

It's worth noting that UTF-8 is a standard I/O exchange format, and I have no plans to change that in Objeck.

So you think rewriting it to have strings to be UTF-8 on all platforms is more feasible?

ghost commented 6 months ago

Stop insulting me!

What's going on? Did I write something wrong?

I have put a lot of work into your requests. You stated that I hacked the code to print a practical value, which is not how I engineer solutions. It takes time and thought to implement such requests.