fut icon indicating copy to clipboard operation
fut copied to clipboard

Write Ć in Ć

Open tq-xyy opened this issue 2 years ago • 4 comments

I think it is cool.

tq-xyy avatar Dec 05 '21 07:12 tq-xyy

Actually, this is a really nice idea: so cito could have bootstrapping backends when being transpiled to quite a lot of languages.

andreasbaumann avatar Jan 25 '22 16:01 andreasbaumann

Yes, that's the plan!

I'd love to have cito:

  • without the dependency on .NET
  • running right in your browser

I've made some progress already: added HashSet and Stack collections, refactored cito to avoid boxing.

pfusik avatar Jan 25 '22 16:01 pfusik

Cool. :-)

andreasbaumann avatar Jan 25 '22 19:01 andreasbaumann

As I wrote in discussion: before writing Ć in Ć , can make C#-> Ć transpiler. People which can much C# code will possibility convert it to Ć before convert to other languages.

andr1972 avatar Mar 11 '22 00:03 andr1972

Current status: lexer fully ported to Ć, most of the AST and the parser ported to Ć.

pfusik avatar Nov 03 '22 13:11 pfusik

Current status: the AST and the parser ported to Ć, the semantic pass partially ported.

pfusik avatar Dec 30 '22 10:12 pfusik

  • without the dependency on .NET

Maybe using .NET NativeAOT is a simpler way to get rid of the dependency on .NET (it compiles C# to native binary code and does not need .NET dependency to run the compiled program).

  • running right in your browser

.NET has an experimental NativeAOT-LLVM compiler to target the wasm platform.

hez2010 avatar Feb 15 '23 07:02 hez2010

Yes, but a .NET NativeAOT binary is going to be tens of megabytes and slower than Ć transpiled to C++. Also, since Ć is about portability between programming languages, it just doesn't look good to rely on .NET for a cross-platform transpiler.

During the rewrite, I added several features to Ć. They will be useful in many other projects.

pfusik avatar Feb 15 '23 08:02 pfusik

Current status:

  • Semantic analysis ported - covered by "CiCheck" tests for Java and JavaScript.
  • The remaining part are backends - started.

pfusik avatar Mar 07 '23 14:03 pfusik

Current status: all backends ported, but with some native C# blocks.

pfusik avatar Mar 30 '23 09:03 pfusik

Great news: we have cito in C++! It passes all the tests and runs much faster than the C# version.

Next steps:

  • Test on macOS and Linux
  • Add CI tests
  • Continue porting to browser JavaScript
  • Update the docs
  • Release 3.0.0 with native binaries for Windows/macOS/Linux

pfusik avatar May 22 '23 16:05 pfusik

Test on macOS and Linux

Works fine with gcc 13 on Fedora 38. xcode on macOS doesn't implement enough C++20. @pdelewski How to install gcc 13?

Add CI tests

GitHub Actions and Travis only support Ubuntu up to 22.04. I can't find gcc 13 or clang 16 packages for it.

Continue porting to browser JavaScript

make -j8 test CITO="node cito.js" passes all the tests. :)

pfusik avatar Jun 10 '23 07:06 pfusik

@pfusik I was installing via brew install gcc 13 is the latest version

pdelewski avatar Jun 10 '23 07:06 pdelewski

@pfusik On Ubuntu 22.04 I built GCC 13 from sources, but that probably won't work in CI.

epi avatar Jun 10 '23 08:06 epi

sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt install g++-13

pfusik avatar Jun 10 '23 16:06 pfusik

The language is now fully implemented in itself, except for I/O. Native binaries for Windows, macOS and Linux can be built with C++20 compilers. A release is coming soon. The transpiler also works in browser JavaScript. It will be present on the language website. And the C#-hosted transpiler continues to work, but is less performant than the C++ version.

I'd like to enable the transpilation to Java for an IntelliJ IDEA plugin. It will probably need small changes in the Java backend (Java doesn't support constant case with a when clause).

pfusik avatar Aug 07 '23 09:08 pfusik

You can now run fut in your browser: https://fusion-lang.org 4K monitor strongly recommended.

pfusik avatar Aug 31 '23 15:08 pfusik