Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haxe-Func : A Powerful Haxe Toolset for TON Smart Contract Development #770

Open
kayx86 opened this issue Aug 25, 2024 · 8 comments
Open
Labels
Developer Tool Related to tools or utilities used by developers

Comments

@kayx86
Copy link
Contributor

kayx86 commented Aug 25, 2024

Summary

Haxe-Func is a toolset built on Haxe that simplifies the development of smart contracts on the TON network. Leveraging Haxe’s mature ecosystem, including its static typing, advanced macro system, and comprehensive development tooling, Haxe-Func aims to provide a reliable and efficient development environment for smart contracts development on TON.

Context

Key features:

  • Mature Development Tooling: Utilizes Haxe's robust IDE support, syntax highlighting, and advanced macro system, which includes LSP integration for code completion and editor enhancements.
  • Reusability of Haxe’s Features: Leverages Haxe's static typing and syntax for clean, maintainable code, reducing errors and improving reliability.
  • Cross-Platform SDK Generation: Generates SDKs for JavaScript/TypeScript to facilitate integration with front-end applications.
  • Unit Testing: Ensures code quality and early error detection through comprehensive testing frameworks.

Benefits:

  • Increased Productivity: Accelerates development time and enhances code maintainability by leveraging Haxe's existing tooling and features.
  • Enhanced Security: Static typing aids in early error detection and minimizes vulnerabilities.
  • Flexibility and Integration: Supports multiple platforms and integrates seamlessly with other tools in the Haxe ecosystem.

Target audience:

  • Haxe-Func caters to both experienced Haxe developers and beginners interested in smart contract development on the TON network. Its integration with Haxe's development tools makes it accessible and powerful for a wide range of users.

Goal:

  • The primary goal of haxe-func is to create a user-friendly and efficient development environment for TON smart contracts, enabling developers to focus on business logic rather than complex technical details.

Technical Approach:

  • Utilizing Haxe: haxe-func builds upon Haxe's existing infrastructure, including its macro system and LSP support, to streamline the development process and enhance tooling.
  • Development Roadmap: The project includes a complete boilerplate setup for generating Func code. Future development will focus on expanding the language features, improving documentation, and integrating additional tooling.
  • Documentation and Tooling: Comprehensive documentation will be developed, including user guides, and tutorials. IDE support will leverage Haxe's existing tooling, providing code completion and other enhancements through LSP integration.

Expected Result:

  • The project will demonstrate the capabilities of haxe-func by successfully implementing a Jetton on the TON network. This will showcase the toolset’s effectiveness and validate its utility for smart contract development.

References

Currently there is no similar tool , this is the repo we are working on
https://github.com/cocrafts/haxe-func

Estimate suggested reward

  • 10.000 USD in TON
@kayx86 kayx86 added the Developer Tool Related to tools or utilities used by developers label Aug 25, 2024
@kayx86
Copy link
Contributor Author

kayx86 commented Aug 25, 2024

@delovoyhomie Please review it

@anton-trunov
Copy link

Some observations from my side:

@kayx86 You might want to add some more technical details here. How exactly are your going to use Haxe and the tools around it to produce the end result?

@kayx86
Copy link
Contributor Author

kayx86 commented Aug 25, 2024

hi @anton-trunov

Thank you for your valuable feedback. You are correct in noting that haxe-func is inspired by the Tact project. However, the primary distinction lies in haxe-funcs utilization of Haxe a mature and powerful language with extensive development tooling. Specifically, haxe-func benefits from:

Mature Tooling : Haxe's robust IDE support, syntax highlighting, and advanced macro system.
Complete Ecosystem: Integration with Haxe’s existing development tools such as LSP, which will enhance code completion and editor support.
While the repository is still in its early stages, we have a complete boilerplate setup that allows for generating minimal foreign code (Func) through the command haxelib run reflaxe test, although it is stub for now, like you mentioned. The grant will significantly accelerate our development, enabling us to delve deeper into building out the project.

We will update the proposal to include a detailed documentation plan and specify how IDE and tooling support will be leveraged. The proposal will also outline how haxe-func’s capabilities, including its macro system and LSP integration, will facilitate efficient development and enhance the user experience.

Additionally, we will revise the "expected result" section to clearly show the successful implementation of a Jetton using haxe-func.

Thank you for helping us refine the proposal.

@kayx86
Copy link
Contributor Author

kayx86 commented Aug 25, 2024

@anton-trunov @delovoyhomie
I just update proposal , please review it

@anton-trunov
Copy link

The project will demonstrate the capabilities of haxe-func by successfully implementing a Jetton on the TON network. This will showcase the toolset’s effectiveness and validate its utility for smart contract development.

@kayx86 I would suggest you first provide an MVP that can be used to implement Jetton contracts and then it would be much easier to assess the merits of the project. Right now all you say is you are going to build on an existing Haxe infrastructure but it's not at all obvious to people (like myself) unfamiliar with Haxe, to understand how exactly you are going to do it.

I would suggest add a quick summary explaining what Haxe is and your step-by-step plan showing what you are going to do. Basically, I'm skeptical about using "compiler constructor" frameworks if that's that Haxe is. (I mean even parser generators are not really mature enough for what people usually want from programming language implementation). I'm happy to change my mind, though.

@fluctlight-kayaba
Copy link

fluctlight-kayaba commented Sep 1, 2024

@anton-trunov appreciate your skepticism, and I’d like to provide a more detailed explanation to address your concerns.

Haxe is a high-level, cross-platform language with a powerful type system and macro capabilities that make it a versatile tool for code generation and transpilation. It is not a “compiler constructor” framework in the traditional sense; rather, it is a fully-fledged language that can generate code for multiple target languages, such as JavaScript, C++, Python, and more.

The advantage of using Haxe for building a transpiler to FunC lies in its macro system and abstract syntax tree (AST) manipulation capabilities. This allows for the creation of a robust and flexible transpiler that can map Haxe’s high-level constructs to FunC’s low-level, blockchain-optimized constructs.

To give you more information to consider, I have continue and developed a basic transpiler that demonstrates the foundational concept and have prepared a demo video to showcase this. This initial implementation proves that the Haxe-to-FunC transpilation is not only possible but also promising.

Me and @kayx86 is super excited and will definitely move forward to fully implement the Jetton standard and other complex smart contracts on the TON network no matter we got the grant or not. Even though, I believe that with the support of the grant, we can take this project to the next level and provide a valuable tool for the TON community. I hope the demo video will help demonstrate the potential of this project, and I am happy to discuss further any questions or concerns you may have.

Thank you for considering the proposal, and I look forward to your feedback.

@kayx86
Copy link
Contributor Author

kayx86 commented Sep 6, 2024

@delovoyhomie please review and feedback . Tks ser , i very happy if you approve and assigne me

@anton-trunov
Copy link

@kayx86 @fluctlight-kayaba I checked the AST traversal code in the linked repo and didn't see anything spectacular that would bring as a new working compiler with a few keystrokes. I'm sorry, but I think you are severely underestimating the effort that needs to be poured in to create a new programming language and an ecosystem around it.

My recommendation would be to not support this major undertaking via bounties. I can see two ways in which this could be supported:

  • it could perhaps be supported via a grant as a big multi-year project with a business plan and milestones, or
  • when the language implementation can compile real-world contracts, bounties can be used to support its development in certain areas, like improving documentation, or some tooling, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Tool Related to tools or utilities used by developers
Projects
None yet
Development

No branches or pull requests

3 participants