Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Axel Huizinga
@axelhuizinga
Yes that's great but is it intended this automatically triggers a build? as in my attempt https://github.com/HaxeFoundation/haxe/actions/runs/455916883
Juraj Kirchheim
@back2dos
typically, CIs are set up to run a build when a PR is created ... but IIRC when you "edit" a file on GitHub, you don't have to follow through with PR creation, if that's not what you want
Axel Huizinga
@axelhuizinga
I wanted the PR but not trigger the build :)
Juraj Kirchheim
@back2dos
yeah, that's not something you can control ... typically, repo owners configure their CI to trigger a build (and run tests) on PRs to see whether they're safe to merge
serjek
@serjek
is that possible to get fields of typedef at runtime, i.e not using macros?
Juraj Kirchheim
@back2dos
mhh, not really, no
Juraj Kirchheim
@back2dos
you can do Reflect.fields, if that's what you're looking for?
serjek
@serjek
it does not work with typedef, but on the second thought, why I even need it runtime? :D
serjek
@serjek
I started to see following compilation warn, but I have no idea what had changed. what are possible causes of this?
4.1.5/std/haxe/macro/MacroStringTools.hx:89: Warning : This pattern is unused
serjek
@serjek
okay it was improper use of inline.
Ties Baltissen
@Skudoku
Hey Y'all, Im researching what language I will be using in my cross platform API. The idea is to find a language in which I can develop said library and then deploy it to as much platforms as possible. So for example make libraries to simply plug into iOS/Android/Windows applications and such. Is this at all possible with Haxe as it stands now?
Thomas J. Webb
@thomasjwebb
Haxe has some limitations if you want to make a library that can be used from multiple target languages. Like it works well for generating a javascript library or a c++ application but not for a c++ library to be used for c++ applications.
Ties Baltissen
@Skudoku
Is there any way to get a list of possible targets that Haxe might be deployed to? I am gathering all kinds of information like that for multiple languages to make a fair and useful decision at the end.
serjek
@serjek
haxe can be used to generate decent js code and is recognised in enterprise. as for cpp target, code it generates contains custom build GC and it's performance is not something you can compare with regular cpp program. so if you're looking for library for multiple platforms/architectures it would be wise to stick to vanilla cpp
Juraj Kirchheim
@back2dos
for Android (compiling a jar via the JVM target) and the web Haxe is a good candidate
for Windows, it depends what that even means, but you can use the C# target to produce dlls that should be straight forward to use in C#
serjek
@serjek
but I must say, having ability to compile it to cpp allows you to offload heavy computations to another thread for single-thread platforms that can do native module extensions, like react native
David
@fayten:matrix.org
[m]
Take a look at daff
Juraj Kirchheim
@back2dos
for iOS, the situation is a bit more complicated, since as the others explained, Haxe does have a C++ target, but it comes with its own runtime (including a GC) and the generated code is not really idiomatic and therefore a rather poor fit for library development
Ties Baltissen
@Skudoku
Alright, so for the iOS situation I could consider creating something that works inbetween to make it usable for iOS perhaps? As for the rest, this sounds amazing. If the app is written in Xamarin, .NET will suffice, Android amazing with .jar, does this also work with JS? Because iOS can handle JS, so maybe I can work around making a library with the JS target.
Juraj Kirchheim
@back2dos
Haxe generates JS code, with an opt-in for ES6 output (proper classes) although currently it doesn't generate getters/setters - but that's relatively easy to solve via macros
David
@fayten:matrix.org
[m]
For iOS a good route would be building your lib as c++ for making a .dylib
Then just use the dylib in your iOS project
Juraj Kirchheim
@back2dos
some language features (e.g. abstracts and enums) translate poorly to JS though, so it's best to not use them in your public API
Ties Baltissen
@Skudoku
This sounds pretty darn good yall. So it seems like most of what I am aiming to do should be possible with Haxe. I assume it would be possible to automate this process to generate libs for these targets all at once?
Juraj Kirchheim
@back2dos
you can get .d.ts typings via hxtsdgen or use genes to generate proper ES6/TS modules
serjek
@serjek
basically it depends on what is your library about to provide. when I hear 'library for multiple targets' I imagine a single call API and complex code that does shit ton of heavy work behind. if that's the case then cpp is your choice, as every modern framework has access to native capabilities.
Juraj Kirchheim
@back2dos
everything can be automated of course ;)
Ties Baltissen
@Skudoku
Basically. There's this hardware company that has recently made Bluetooth capabilities available for their devices. These data that will be transmitted over Bluetooth are in a certain protocol. The value of the libraries will be so that the developers (Since engineers can also make their own apps and talk to the devices) can use a library for their platform of choice to simply translate the data up and down the stream.
So it's more of an API wrapper, but then thoroughly tested and all, since it can go as far as hardware thats hooked on to respiratory systems, thats what makes the research Im doing now very important, making the most viable choice for a language to target at much as possible with the least possible harm.,
serjek
@serjek
so since you don't need heavy calculations done with speed of native then haxe is good choice in terms of flexibility and maintainability. you can keep single code for all your targets with conditional compilation applied as needed
Ties Baltissen
@Skudoku
Sounds amazing, this was really helpful. I actually just found out about Gitter aswel, so expect to see me here more hah.
Thanks so much so far!
Ties Baltissen
@Skudoku
Quick question, whats the best editor to use for Haxe?
David
@fayten:matrix.org
[m]
VScode with the haxe plugin
works very well
David
@fayten:matrix.org
[m]

Heads up Gitter is going away at some point. Might not be for another year though. Gitter was acquired by Element foundation and is slowly being absorbed.

https://blog.gitter.im/2020/09/30/gitter-element-acquisition/
https://matrix.org/blog/2020/12/07/gitter-now-speaks-matrix

You can access all gitter rooms with element.io since they are now just Matrix rooms. The gitter client will be phased out though.

Ties Baltissen
@Skudoku
Thanks! Working with that now yeah, feels nice.
David
@fayten:matrix.org
[m]
Also one more thing
this is pretty new, but it's made by George Corney who has been around Haxe for a while.
I think it could be very useful for your project:
https://github.com/haxiomic/haxe-c-bridge
Ties Baltissen
@Skudoku
Awesome! Thanks so much
Kevin Leung
@kevinresol
I got a haxe enum question, if anyone is interested: https://community.haxe.org/t/representation-of-a-c-struct-with-haxe-enums/2852
David
@fayten:matrix.org
[m]

Looks like Java is getting self hosted support in Graalvm.

https://medium.com/graalvm/java-on-truffle-going-fully-metacircular-215531e3f840

I don't have time to play around with it at the moment, but it could lead to some interesting use cases. Since it can AoT the entire runtime and JIT I believe this would allow for easier runtime scripting of JVM languages like Haxe.

Core Haxe application -> single executable -> Runtime scripting with Haxe and other langauges that can create java bytecode.

Could be neat. Unfortunately you'd lose ZGC and Shenandoah though and those are just way too nice for bulk allocations and deallocation.

Juraj Kirchheim
@back2dos
why would you lose them? does Substrate VM have a different GC?
David
@fayten:matrix.org
[m]

As of right now substrate only haa access to a serial GC and the G1GC if you have an enterprise license.

I imagine in the future more GCs will be implemented for substrate.

Juraj Kirchheim
@back2dos
oh, ok ... wasn't aware of that ... I wonder if that doesn't make native images slower for long running apps
David
@fayten:matrix.org
[m]

Native-images are definitely slower than hotspot. I would say they profile very similarly to OpenJ9, but with pretty decent memory usage. Again this is all prone to change in the future. I haven't needed to distribute anything yet, and jigsaw can still get a package down below 50MB which beats out electron apps in most cases.

I did a super simple test with SWT and got a native-image at about 14mb and it only consumed 23mb of ram and 38mb when the app was full screened.
Of course this was an extremely simple demo app that just had 4 dynamically sized buttons.

https://imgur.com/3otiHA2

Similar results on OSX and Windows.

David
@fayten:matrix.org
[m]

This was way back in November though, and graalvm moves pretty fast.

Native-image also doesn't work for everything. Skija (skia for the JVM) doesn't work with it due to some weird JNI errors. https://github.com/oracle/graal/issues/3005#issuecomment-733372380

The plan is to provide some basic native-image profiles in the future for my Haxe libraries so I can provide some native-image.hxml files for my haxe libraries.