Thanks! Yeah, a bit crazy.
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
I do have a suggestion, even crazier. If you can, make it 100% haxe compatible, such that classes written in haxe will be compiled along with classes written in tng (or whatever you call it). This way you will not loose all the libraries written in hx syntax. That would make the haxe language GROW instead of Split.
Anyway, I would be happy to hear updates.
I already spent half a year. The hardest part is in past. Writing compiler (from scratch) in Haxe IS simple. I really was very surprised. Ocaml was mindblowing for me. Lexer and parser a fully handwrittend and its totally okay. Yeah, of course I'm using Ocaml sources as references :) The complete testing suite makes me happy too!
I really don't see the point to use Ocaml (for writing compilers) at all.
Haxe's ADTs and matching system makes such task stupidly simple.
Simn even has a lexer-parser framework for Haxe written in Haxe + some macro magic. But I want the most optimal way of doing things here, expessially because of new lexeme-level macro system ;)
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
Woaw It sounds very ambigious what you are trying to accomplice; building and maintaining compilers for me looks quite "hardcore" :) I feel your enthousiasm! What is your drive when you are working on this already for so long!?
I already asked something on twitter, but I have some questions:
- why not bundle your enthousiasm+code powersss with the current team and just join them? I think we can use all help!?!
- what does "more productivity-ready" exactly means? If i can work faster Im very interested (!!) :)
Enjoy
Started to write about language differences. The problems are partially marked too, with samples.
https://github.com/PeyTy/Alternative-Haxe/blob/master/doc/Language_Differences.mdHello, Mark! I was to emotional that day. So, more unrolled answer:
| What is your drive when you are working on this already for so long!?
This is just a small part of big plan :D
/* Haxe will become a SkyNet and kill humans...hah...joking! */
Just enjoy improving things, and need a solid fundament for future.| just join them?
To early to say. This project is very different from what HF are doing.
| what does "more productivity-ready" exactly means?
I wrote "production-ready". Not loosing productivity of course :)
- backwards compatibility, no breaking changes (after 2015, I think). Like in Java and AS3
- more updates, continuously, just-in-time
- mainstream simpler syntax+features, so more recruiters will be in future
- more solid, highly maintained built-in targets, and less built-it targets overall
- better flexibility
- 100% enforced documentation
- compiler written in Haxe is easy to maintain for other companies
- complete toolkit (re-factoring as an in-compiler tool, so IDE agnostic)
- etc etc etcYou can read Daniel Glazman`s messages in WWX 2015 Videos. His words made my vision of problem complete.
(Its not meant, that I fully agree with him, and depend on him - I started project long before all these community misunderstandings)
Hello, Hugh! Thank you for sharing!
| it is written in haxe, and it's not GPL
;)
| The current haxe compiler architecture goes a bit like this
My compiler is already different. Macro can work at lexemes level. Parser generates expr and types directly.
| I am seriously thinking about moving or duplicating the hxcpp backend in haxe using a technique like this.
In Alt Haxe generators are macro plug-ins by design (like JSGenAPI). I must mention, because you understand the thing, about JIT optimizing of macro (similar to cppia). So no performance drop here.
| duplicating the type-inference ... exactly match haxe
I dont like some parts of the inference behaviour of Haxe.
| self-hosting
It will be
| The full stack is a big task
I wrote a big answer to you, but when got to this sentence I can finally say:
I AM WRITING EXACTLY A FULL STACK
Writing a compiler doesn’t mean to be an impossible task.
About HXCPP. It may sound to you like there is a competitive tech :) but own C++/LLVM back-end is a core part of new compiler stack.
I dont want to say that your work is bad or something. But Alternative Haxe will be more adopted for native execution by itself and contain LLVM bakend inside, for macro execution and generating binaries. Yeah, not about all those cool c++/objc interop stuff.
But HXCPP CAN be, and it will be cool, one of the backend plug-ins to generate interopable code without FFI!
Hugh, what is haxe-only-with-better-syntax? :)
I am making a haxe-only-with-better-syntax and some features on top.
If not so, I`d named it like "Alternative Yet Another HTML-but-for-programming Language"
:Ъ
You can read my diff - https://github.com/PeyTy/Alternative-Haxe/blob/master/doc/Language_Differences.md
Less quirks. Mostly everything is same.
Hugh
Okay I will write a macro for that, no prob.
(You are right)
Hugh
Okay I will write a macro for that, no prob.
(You are right)
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
Community wants short lambdas for last 5 years. I am not a part of Haxe Foundation. I am a part of this community.
| If the hill will not come to Mahomet, Mahomet will go to the hill.
@Brennan
| With the no semi-colon support, I take it you can run into the Automatic Semicolon Insertion(ASI) issues that you might see in JS/AS3?
Yeah, I fully understand - it will cause problems. This may be solved by promoting a one style global guide, like here https://github.com/bengourley/js-style-guide
it covers semicolon problem.
| You are altering Haxe to work with different syntax/features?
| Language/compiler will be in AltHaxe instead of Ocaml?
Yes, full selfhosting
| Targets such as PHP, JS, C++ are handled via macro?
JS and CXX (C++ & LLVM) will be built-in. Other are via macro. Like JSGenAPI, but much better and flexible.
| Language features/syntax can be added with macro but require '@' such as await becomes @await?
There is many types of macro.
1. Lexeme preprocessor, for extending syntax itself (without any requirement, only limited to predefined set of tokens)
2. Classic macro functions. I think it must be replaced to @meta
3. @meta macroses. They works like attributes and can call macro-functions, depending on context
4. Macro classes. Its from original Haxe. Have not yet investigated. Never usedThis is really not fully finished. The core concept of new macro system to make it "obvious". YellowAfterLife wrote recently that "@metas fail silently, while calling macro function will work always" -> I want to not allow such situations. @metas must be defined somewhere, to be used.
| Core syntax of AltHaxe will be strictly chosen as is the case with Haxe, community can extend via the macro method(but this is better than current macro method with Haxe?)
To be honest, current macro method is _very_ limited. Saying, for example, "you can just use macro to implement short lambdas!" is not true.
In AltHaxe you limited only on token level, not AST. So anything is possible.
Core syntax _of course_ will be strictly chosen. It must be very-very simple, understandable, eye candy, and powerful. But power comes from type system, theorem-solvers (static analyzing), ... and macro.Dont think that I want to simplify and change syntax _only_ because of these reasons. It will be a really gift for community, maintainers and newcomers.
| '=>'. '?.' '??'. Does AltHaxe make it possible to configure language like this?
Yes. Definitely. New tokens can be proposed, but its more like "just add more ASCII chars to token list" :) And... most of them already here.
| this could lead to fragmentation
Macro system works only on-demand on a per-file or even per-expression basis. Language cannot be fragmented by design.
Someone could write his lib in one dialect, and it can be safely used in a lib with another dialect.Think of Haxe as of Intermediate form. There is Tardis Go. Believe it or not, it will be possible even to use subset/kindof of Go just like a "yet another .hx file".
I already wrote Hugh about such macro to use Haxe 3.2 subset some messages above.
| I know normally you'd want a more controlled language as this could lead to fragmentation or different implementations perhaps when handled via community. If you take same stance/view as Nicholas, then when community wants to add to the language, what can be done? We can implement through this different macro approach? Or are there other ways? See the features Patrick demo's with his fork of Haxe, will AltHaxe be flexible to support these additions or would the language need to be modified in a way that my project source code will not run for another user unless they modify(or use fork) AltHaxe too.
"Language cannot be fragmented by design."
"Macro system works only on-demand on a per-file or even per-expression basis"
"extending syntax itself (without any requirement, only limited to predefined set of tokens)"Example: http://hacking-haxe-dev.atouchofcode.com/#0de59
```
import PatrickDialect.apply; // Syntax will be changed. Maybe `using` fits better, or new keyword... anyway - import a macro first
// The macro is defined inside a some class, like always you do#apply // enable preprocessor on a whole file basis
// maybe enabling via `using PatrickDialect.apply;` without a #this will be considered. #this syntax is more about "just apply this macro HERE and NOT any other place"
// but really only macro developer decides how his/her macro worksobject EMath { // we enabled macro because there is not standard "object" keyword. so we need a lexer-level macro to support it.
@tco def fact(n, acc=1) return if (n<1) acc else fact(n-1, n * acc); // I just removed `:` so `@:` to `@`. Old meta-informational (non-macro) metas syntax is WIP
}// def is also implemented in same macro. but say, it is NOT (just for example):
object EMath {
@tco #def fact(n, acc=1) return if (n<1) acc else fact(n-1, n * acc);
// def became #def.
// I `def` is just a shorthand for `function` its fun :)
// it will just replace current token
// and CONSIDER -> #macro CAN be nested like `var a = #do #other #another 42;` and WILL NOT conflict (pure magic!)
}class Test {
static function main() {
trace(EMath.fact(12));
@tco function sum(n, acc=0) {
// @tco works at AST level.
// it takes args like @tco(a,b,c) and only second expression after `@tco this_expr;` (whole function node in this case)
if (n < 0) throw "n can't be negative";
if (n==0) return acc;
return sum(n-1, n+acc);
}
trace(sum(40));
}
}
```As you can see - the solution is solid. I wont tell you all those marketing /***/ if it will not be possible. I was shocked when the solution (implementation) came to my mind!
| I believe Go also has a code format tool
Its already considered to be built-in. IDE must not support all this crazy stuff. Also, I am using Sublime, and it is not even an IDE :)
About original Haxe you may ask HF. I dont know why they didnt do this already.
And...
| stance/view as Nicholas, then when community wants to add to the language, what can be done
There is PLENTY of things to be done. Syntax is just nothing (hah, you can extend it by yourself!).
- Generating native binaries from compiler directly
- Making macro as fast as possible
- Making more unit tests
- Making generated code as optimized as possible
- Making smart error-detectors
- Extending STD
- Writing macro to support externs from another langs (like TypeScript`s .d.ts to be used in Js target)
- Extending toolkit
- etc etc etcCommunity must understand this amount of work, and learn some macro magic. And no "Nicholas" problems will be involved.