Haxe

Haxe

Postby dulsi » 26 Jul 2017, 15:33

I decided to look at Haxe. I tried kivy earlier but wasn't entirely satisfied with it. I wondered how haxelib worked on Fedora. Rather than modify my machine I created a VM of Fedora 26. Haxelib requires you to run "haxelib setup" first. It wants to write files in /usr/share/haxe/lib so effectively it needs to be run by root. I tried compiling to C++ but that tried to used haxelib to install the C++ backend. I really dislike languages that handle installing things for you. I understand the convenience of it but I like to know exactly what I'm installing and depending on.
dulsi
 
Posts: 75
Joined: 18 Feb 2016, 15:24

Re: Haxe

Postby c_xong » 27 Jul 2017, 00:38

How would you do it if instead of Haxe, it was GCC? You would need to download the source and make. Also if you don't like package managers you don't have to use haxelib, just download the package directly from https://lib.haxe.org/.
User avatar
c_xong
 
Posts: 202
Joined: 06 Sep 2013, 04:33

Re: Haxe

Postby dulsi » 27 Jul 2017, 04:12

c_xong {l Wrote}:How would you do it if instead of Haxe, it was GCC? You would need to download the source and make. Also if you don't like package managers you don't have to use haxelib, just download the package directly from https://lib.haxe.org/.

I like package managers. I don't like having multiple package managers. I like visibility in my package manager. If I ask to install A, it tells me it will install B and C. If I try to run a command, I don't expect it to notice that it is not installed and install it without asking me. Part of the problem with haxelib is I don't know what it does. Does it just download files and put them somewhere or does it run scripts? Fedora has strong rules about package quality. Does haxe have strong standards? By having packages created by Fedora community, you can expect everything to just work. If I install haxe from Fedora package and then try to install a haxelib, I can find the latest version doesn't work with Fedora's version of haxe. (Looks like the developers behind haxe maintain the packages for Fedora so that probably isn't a big deal.)

The lack of information is disturbing to me. To setup openfl, I'm instructed to run 'haxelib install openfl' and 'haxelib run openfl setup'. I get what the first command does in general. What is the second command doing? Want to create your own project using openfl run 'openfl create project HelloWorld'. Want to use haxefixel, use 'flixel tpl -n "HelloWorld"'. What are these commands doing? Why is each library creating a new command to do it?

EDIT: I decided to download the hxcpp library to see what it includes. It don't see anything suggesting it runs a script but it does include some binary libraries. So if you install hxcpp, you have another install of zlib on the system.
dulsi
 
Posts: 75
Joined: 18 Feb 2016, 15:24

Re: Haxe

Postby c_xong » 27 Jul 2017, 06:18

Ha, welcome to modern development. Many languages have their own package managers, and for good reason: they are updated faster, and they are platform independent. Usually these package managers can be set up without root, don't know how it can be done for haxe but it makes sense to be able to. Python, Ruby, Node.JS, golang, take your pick, they all work this way.

Also, if you dig a bit further you can find what openfl setup is doing: https://github.com/openfl/openfl/blob/d ... nScript.hx. The information you're reading is opaque because that's what the target audience wants: a tl;dr version of setting everything up, for people who trust Haxe and their ecosystem.
User avatar
c_xong
 
Posts: 202
Joined: 06 Sep 2013, 04:33

Re: Haxe

Postby galoyo » 27 Jul 2017, 10:50

hi. the install script will install files into places of the hard drive. if you do not want that then just download the zip. I have haxelib installed on Linux and windows. there is a tutorial at http://github.com/galoyo/SpaceCastle/wiki in that tutorial haxe installs at home/haxe or c:\haxetoolkit. just unzip files somewhere at home then run haxelib setup to set the path of the lib which can be a folder at the root directory of haxe. install a lib with "haxelib install lib version" or "haxelib install lib". lib is the library to install.

if you download the lime lib then a folder lime will be created inside of the lib folder. When you install a lib, it downloads the files from repo and places them into the lib folder such as the lime folder and inside that folder will be a folder with the name of a version number of lime and all files those will be inside that version number folder. /haxe/lib/lime/2,9,1/

the link I gave is for installing both haxe and then haxeflixel which is the game library. see this link about help wanted to get haxeflixel to work with openfl5 http://community.openfl.org/t/call-for- ... l-5-x/9345
Last edited by galoyo on 07 Aug 2017, 12:09, edited 1 time in total.
galoyo
 
Posts: 10
Joined: 20 Apr 2017, 00:53

Re: Haxe

Postby dulsi » 27 Jul 2017, 14:25

c_xong {l Wrote}:Ha, welcome to modern development. Many languages have their own package managers, and for good reason: they are updated faster, and they are platform independent. Usually these package managers can be set up without root, don't know how it can be done for haxe but it makes sense to be able to. Python, Ruby, Node.JS, golang, take your pick, they all work this way.

I understand that and that causes things like the left-pad problem in Node.JS. Node.JS community is the one I dislike the most. Everyone wants you to use the latest version of their library but they don't trust other libraries being stable so they specify exact version in dependencies. It not even unreasonable that they don't trust others because I doubt many understand how to maintain a stable API.
dulsi
 
Posts: 75
Joined: 18 Feb 2016, 15:24

Re: Haxe

Postby c_xong » 28 Jul 2017, 02:39

Well you don't have to use the latest versions, in fact freezing versions is the prudent thing to do. Before updating to a later version, you should be aware of the risks, e.g. given that you trust the developer uses semver properly, keep the patch version up to date, the minor version if the changes apply to you, and the major version only if you're prepared to review the breaking changes.

Apart from that, what alternative to language package managers do you prefer? Do you want a single monolith like Unity so you don't have to worry about package management? Do you want to handle package management yourself and hunt the dependencies manually?
User avatar
c_xong
 
Posts: 202
Joined: 06 Sep 2013, 04:33

Who is online

Users browsing this forum: No registered users and 1 guest