Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
pypmannetjies
@pypmannetjies
Hi there - is Haxelib down?
Zaphod
@Beeblerox
it's working on my end
pypmannetjies
@pypmannetjies
Apologies it's probably an issue on my side
Zaphod
@Beeblerox
probably
Daniel Kuschny
@Danielku15
small question to the crowd: Has anybody seen a macro which implements ES5 Getter / Setters automatically? The HaxeFoundation/haxe#5104 has been open since ages and also seems still to be in design phase. As an intermediate step I'd also be fine to have some macro, JS-generator that removes the underscore from the getter/setter functions. While they totally make sense in Haxe, they are causing rather uncommon code-style practices in JavaScript.
Marcelo Serpa
@fullofcaffeine
@Danielku15 No that I know of, but I think a custom js gen would be needed. Have a look at https://github.com/kevinresol/hxgenjs, and extend it to generate the ES5 artifacts.
Philippe
@elsassph
This isn't a simple change because the compiler generates code using the functions when relevant, and you can't just generate native JS propos everywhere automatically.
Balaji Peddamuthu
@balajipdm
I have created my own customized front-end framework based on Haxejs, Material Design Lite, Webpack, Is there any way to abstract this framework to use externally (host as haxelib in our private environment and later opensource it) ?
Juraj Kirchheim
@back2dos
it'll probably be easier to put on npm, since that's where most of the dependencies are
Marcelo Serpa
@fullofcaffeine
Hey guys, how do I nullify a function body in the macro context? I'm trying to fix this issue on haxe-js-kit: clemos/haxe-js-kit#179. The error happens because apparently the fun here: https://github.com/clemos/haxe-js-kit/blob/develop/util/CopyMethods.hx#L58 has an expr when the access is not Inline. This block of code shown in the previous link is the right case, it correctly sets as inline and sets the body of the func, but when the func is not inline, expr should be null, and for some reason it's not, so I'd like to force it to be null. It appears as if it'd accept null since the type of expr is Null<Expr>, but if I assign null, then it errs with "Function body required"...
I just want a function without a body expr
Juraj Kirchheim
@back2dos
but the access is inline, no?
extern non-inline functions must not have bodies (and all extern functions must have fully typed signatures) ... and non-extern functions must have bodies too
Marcelo Serpa
@fullofcaffeine

@back2dos You’re suggesting making all of them inline? I honestly don’t fully understand th code in CopyMethods.hx yet, there’s a case here https://github.com/clemos/haxe-js-kit/blob/develop/util/CopyMethods.hx#L56 that I did not grasp fully. If I make all of them inline by adding AInline here: https://github.com/clemos/haxe-js-kit/blob/develop/util/CopyMethods.hx#L53, then it somehow misgenerates the function (i.e using .post. from Middleware.hxwill generate am-search` for some reason).

Anyway, at this point I guess it’s better if I create a ticket at the js-kit repo. It works for now but there’s a lot of annoying warnings as reported here: clemos/haxe-js-kit#179.

Marcelo Serpa
@fullofcaffeine
CopyMethods is used here: https://github.com/clemos/haxe-js-kit/blob/develop/js/npm/express/Middleware.hx, and this is where the warnings point to (a lot of them for each of the copied methods)
tjrhodes
@tjrhodes
are you beautiful people using pymysql for python3 > MySQL goodness? want to compile a C command line thing to python so i can use weasyprint directly as an API rather than starting processes but the haxe python target lacks MySQL (presumably because vanilla python only supports sqlite)
imcasper
@imcasper
Hello! How can I fix this error?
Marcelo Serpa
@fullofcaffeine
@imcasper I’m afraid there’s not enough data about your issue for anyone to help you. If you could elaborate that’d be better. Include more info about what app is that, what it’s doing, the target and runtime, what the code that fails does, etc.
imcasper
@imcasper
I thought this was an internal problem with the garbage collector. I sometimes had problems in this file. Which are not directly related to my code. Therefore, it was impossible for me to determine the cause of the failure.
For example, I changed the debugger a bit so that the debugger does not fall off in some situations. maybe this is somehow connected. Although I more hoped that this was a known bug, which was fixed in the new version.
Marcelo Serpa
@fullofcaffeine
@imcasper Again, this is not an hxcpp-specific chat. You need to provide specific details about the app and code if you want answers.
Not sure if there’s an specific gitter for hxcpp
or maybe try the haxe forums, community.haxe.org
Simon A. Asselbergs
@s-a-asselbergs

I cant figure out to use custom meta data to execute @:build macro

How do I get this to work (without extending/implementing)?

// HashableClass.hx
@:hashCodeBuilder()
class HashableClass{
}
/*
so it becomes virtually
class HashableClass{
public function hasCode():UInt{
return 46061;
}

instead of using 
@:build(base.HashCodeBuilder.build())
class TestClass {
@:hashCodeBuilder()
class HashableClass{
}

*/


//HashCodeBuilder.hx // the macro
class HashCodeBuilder{
    public static function build():Array<Field>{
        var fields = Context.getBuildFields();
        var value = NumberTheory.getRandomPrime();
        var pos = Context.currentPos();
        var hashCodeFunc:Function={
            expr: macro return $v{value},
            ret:(macro:UInt),
            args:[],
        };
        var hashCode:Field ={
            name: 'hashCode',
            access: [Access.APublic],
            kind: FieldType.FFun(hashCodeFunc),
            pos:pos,
        };
        fields.push(hashCode);
        return fields;
    }
}
Marcelo Serpa
@fullofcaffeine

I'm trying to get the default object from a js module when requiring it using js.Lib.require(), but Haxe complains default is unexpected:

var foo = js.Lib.require('the-module').default
                                                                             ~~~~~~~

I can't use default in that context? It works for other identifiers.

If not, it'd be nice if js.Lib.require would accept a second parameters like jsRequire does.

Danny Yaroslavski
@dyarosla
I’ve run into a GC question for the Csharp target: for any dynamic function invocation like the following: https://try.haxe.org/#4ee6D it seems to generate code that creates a new closure object each time f is invoked. Is there a workaround way to not have it generate new objects each time? This results in poor GC thrashing
Maybe thrashing is the wrong word but
Def over-allocation
Juraj Kirchheim
@back2dos
@fullofcaffeine js.Lib.require('the-module')[cast "default"] will do
or just untyped require('the-module')['default']
Marcelo Serpa
@fullofcaffeine
@back2dos Ohh niiice :) Forgot about cast
Marcelo Serpa
@fullofcaffeine
Thanks, Juraj!
Joakim Ekbladh
@Ploxie
Hello,
I'm trying to import java.util.function.Predicate but since "function" is a keyword it gives me errors :/
How to fix?
Marcelo Serpa
@fullofcaffeine
@Ploxie That’s a weird case if that comes from the Haxe std externs for java. I never used the java target though. How are you trying to import it? Could you share a snippet of that code?
Andreas Drewke
@andreasdr
Hi anyone online still?
I need some help with compiling haxe to be used with HashLink. I was able to compile haxe but hashlink always tell "invalid version" or something similar. I guess most of you know this issue.
I want to integrate Haxe/HashLink into my 3d engine. https://github.com/andreasdr/tdme2
Andreas Drewke
@andreasdr
I am building using "opam install ."
Andreas Drewke
@andreasdr
This is what I get If I run a Haxe->hl binary with hl
"Found version 1 while HL 1.10 supports up to 5
Unsupported bytecode version"
Andreas Drewke
@andreasdr
Oh I downloaded haxe from "https://build.haxe.org/builds/haxe/". Now I get my test script running. Thank you :3
Dejaime Antônio de Oliveira Neto
@dejaime
Hey guy, I'm having some trouble with Haxe generics
@:generic
class Value<T> {
    var v:T;
    public inline function new (v:T) {this.v = v;}
}

class Data {
    var intValueList:List<Value<Int>>; //Works as expected
    var valueList:List<Value>; //ERROR: Invalid number of type parameters
}
Is there any way of creating a List of Value that would accept any type T?
Rudy Ges
@kLabz
List<Value<Any>>?
Dejaime Antônio de Oliveira Neto
@dejaime
@kLabz Yes
Rudy Ges
@kLabz
But yeah that's not exactly what you want; you need another generic thing
Dejaime Antônio de Oliveira Neto
@dejaime
@kLabz Actually I didn't even know I could use Any as a type
just getting my feet wet with Haxe
thank you!