Giter Club home page Giter Club logo

try.haxe.org's Introduction

try.haxe.org

CI

The try-haxe project is a browser-based IDE for testing Haxe code. It provides a quick and easy environment for playing with the Haxe language and compiles to JavaScript, Eval, HashLink or Neko, instantly viewable in the browser. It also allows saving and sharing of programs with the auto-generated hyperlink hash-codes.

The official project is hosted at try.haxe.org.

This repository is a direct successor of try-haxe project founded by clemos and it's fork the dockerized mrcdk version by mrcdk.

Technical notes

The try-haxe project is written in Haxe, with part of the application compiling to JavaScript for use on the client, and part of the application compiling to PHP as a backend service. The backend PHP service provides server-side compilation of programs as well as language auto-complete results. The backend uses Docker to enable the use of multiple Haxe versions and macro support.

Run your own instance (Docker)

Install Docker and docker-compose

https://www.docker.com/get-started

compile application

npm i lix
lix download
haxe build.hxml

build all containers (in project root)

docker-compose -f docker-compose-all.yml up -d

you should get http server on 127.0.0.1:623

Note: you might have to adjust web container's gid for docker group, to match your outside docker's gid. also make sure outside www-data user is part of docker group.

install Haxe versions

(outside container - copy selected versions from your local lix installation). new versions show up after reloading your browser.

cp -a ~/haxe/neko lixSetup/haxe/neko
cp -a ~/haxe/versions/4.1.5 lixSetup/haxe/versions

Recompile haxe code after you change source code outside

haxe build.hxml

To shutdown container

docker-compose -f docker-compose-all.yml down

Linux

Docker group can have a different group id / number than the web container's docker group. To fix it find docker group id:

cat /etc/group | grep docker

then use docker exec -it try-haxe_web_1 /bin/bash to enter web container and edit /etc/group inside:

apt install vim-tiny
vi /etc/group
# find entry with docker (should be last) and change number to host group id
:wq
service apache2 restart

macOS

After building containers run:

docker exec -it try-haxe_web_1 sh -c "chgrp docker /var/run/docker.sock; chmod g+w /var/run/docker.sock"

try.haxe.org's People

Contributors

alexhaxe avatar as3boyan avatar austineast avatar azrafe7 avatar bwkam avatar clemos avatar dependabot[bot] avatar dr-emann avatar gama11 avatar klabz avatar markknol avatar mrcdk avatar nicom1 avatar pleclech avatar profelis avatar rblsb avatar tariqbenezza avatar tkawachi avatar tobil4sk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

try.haxe.org's Issues

Metadata example is giving an error

I loaded the Metadata example on try.haxe.org and it compiles with this error:

TypeError: haxe_rtti_Meta.getFields(...).value is undefined,[https://try.haxe.org/program/eaACf364/run?r=0.9682007150246583](https://try.haxe.org/program/eaACf364/run?r=0.9682007150246583#23),line:23

Hashlink target does not work

I was quite surprised to see Hashlink in the targets list.

Running with the Hashlink target (unsurprisingly?) results in an error. The error is as follows:

timeout: failed to run command '/opt/hashlink/hl': No such file or directory

Tracing type with $type does nothing

Hi,

From the Tracing Types documentation page, I can use $type(...) to debug a type at compile time.

If I run this code in try.haxe.org, nothing appear in the output panel:

class Test {
	static function main() {
		var myValue = "foo";
		$type(myValue); // String
	}
}

Is the feature available?

Thanks!

Tink state fails to compile with haxe 4.2

Tink state fails to compile with haxe 4.2

/tink_state/0.11.1/haxelib/src/tink/state/Promised.hx:15: characters 7-34 : error: Dynamic should be next.B /tink_state/0.11.1/haxelib/src/tink/state/Promised.hx:15: characters 7-34 : ... have: tink.core.Promise<Dynamic> /tink_state/0.11.1/haxelib/src/tink/state/Promised.hx:15: characters 7-34 : ... want: tink.Promise<next.B> /tink_state/0.11.1/haxelib/src/tink/state/Observable.hx:71: characters 34-41 : Invalid call to static function flatten through abstract instance

To be able to compile you must use haxe 4.1

Show C source in HL output

I often find myself wanting to see how hl/c deals with certain things (inlining, allocations, abstracts, etc).

JS already has this, adding it to HL would be neat too. Possibly as an additional toggle in the settings page since this will require a second compilation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.