Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upPython support #2924
Conversation
Simn
and others
added some commits
Mar 28, 2014
frabbit
and others
added some commits
Apr 25, 2014
Simn
assigned
ncannasse
Apr 27, 2014
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
delahee
Apr 27, 2014
Contributor
Awesome :)
2014-04-27 19:24 GMT+02:00 Simon Krajewski notifications@github.com:
This pull request adds the -python command, allowing compilation
of Haxe programs to python 3.The implementation passes the Haxe unit tests as well as several other
projects we tested.Modification to the Haxe core are minimal:
- common.ml: add Python as a target along with its configuration
- main.ml: add the -python command and handle Python as a target where
required- Makefile: add genpy module
- the rest of the implementation is in the file genpy.ml
Standard library files are modified where required, mostly by adding #if
python sections with implementations. Additions include various files
under std/python with the following structure:
- std/python: Various types which can be freely used by users.
- std/python/internal: Special Haxe runtime types to help with Haxe
conformance.- std/python/io: IO helper which are used by the Haxe IO API.
- std/python/lib: Externs for the python standard library.
Missing are some implementations in sys.net and everything in sys.db. We
will add that a bit later.
You can merge this Pull Request by running
git pull https://github.com/Simn/haxe genpy
Or view, comment on, or merge it at:
#2924
Commit Summary
- let's try it like this
- add Sys dummy fields
- add @:coreApi to Math
- add @:coreApi to Array
- merge DateTools
- add @:coreApi to EReg
- remove Lambda
- merge Serializer
- merge List
- merge StringTools
- found the FileSystem implementation
- implement most of Sys
- Sys fixes
- add basic sys tests
- list all cases explicit in transform1, fix minor do while problem
- Merge pull request #23 from frabbit/genpy
- enable increment/decrement optimization
- Merge pull request #24 from frabbit/genpy
- put parenthesis around not expr like (not expr) to avoid binding
errors- it's 'Not' not 'OpNot'
- Merge pull request #25 from frabbit/genpy
- improve code readability (whitespace removed)
- ensure operator precedence
- Merge pull request #26 from frabbit/genpy
- add list to keywords
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- don't handle keywords if function is extern, add keyword test
- initialize bigEndian
- remove redundant newlines
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- purge more whitespaces
- remove whitespace between static inits
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- remove junk
- deal with FDynamic and FAnon access on String.toLower/UpperCase
- remove some unecessary tabs
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- add very basic File operations (Bytes are still missing)
- implemented python based Bytes, get getBytes and saveBytes working
- fix ba should be buf
- use default for file open buffering
- add Utils module
- actually init the Transformer
- use read(-1) instead of readall()
- use Reflect.field/setField on dynamic field access
- remove -cmd from compile-python.hxml
- minor
- cleanup some circular dependencies
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- implement keywordhandler with python types
- minor cleanup
- move KeywordHandler functions to Reflect directly
- fix reflection of core type fields paritally
- reflect on all fields of String and Array, use Macro to hide python
specific field access/call, move all of string and array implementation to
impl classes- whitespace cleanup
- remove obsolete FDynamic match cases
- move println implementation to python.Lib
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- quick fix for print/println
- add = None if non-optional arguments follow optional ones (closes
frabbit/hx2python#13)- add getChar support, flush in Lib.print and Lib.println
- python 3.2 compatible getChar
- it's msvcrt not msvrt
- typo fix
- removed trace
- rethrow the error if getchar doesn't work
- msvcrt.getchar returns an int
- getchar returns bytes
- print char in getChar
- implement systemName and use it in getChar
- add Sys.cpuTime
- put env should change the real environment
- it's Os not Sys
- Merge branch 'development' into genpy
- in progress: trying to get input and output working
- try to get Process working (in progress)
- fixed Process (at least my small test is working)
- move Tools content to StringImpl
- remove Debug.hx
- format
- use Reflect.field for closure access on String and Array
- fix static init order
- fix generation order of statics again
- cleanup dependencies (first run)
- cleanup imports
- minor
- merge development
- they don't make sense for python currently
- test polygonal-ds
- run python -V on travis (and fix some other things)
- try using python version key in .travis.yml
- Revert "try using python version key in .travis.yml"
- use python3 command
- Merge branch 'development' of github.com:HaxeFoundation/haxe into
genpy- init not necessary for builtin
- delegate more python syntax to Macros class (rename Macros to Syntax
is the next step- rename python.Macros to python.Syntax
- add print_params_named to print named functions calls like
sort(key=my_key_func)- support leading colon syntax like a[1:]
- get rid of dirty python__whatever syntax in some classes
- get rid of untyped code in Sys
- no need for preCode anymore
- remove old code
- remove Macros class
- support native assign
- more cleanup
- a little bit more cleanup, but we should get rid of HxOverrides if
possible- allow closure creation on extern static inline methods (closes #2813)
- remove sys.py
- remove python special case in TestMisc
- we don't need casts in python and we don't have to handle the inner
expr with is_value=true- return some proper types if possible
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- get rid of some HxOverrides
- some minor fixes, added some comments that we have to deal with
field access on anons in general- minor
- inline is not necessary
- move array get and set to ArrayImpl
- rename array set and get, next step TArray on lists should directly
call ArrayImpl- a little bit of Reflect cleanup
- cleanup Type
- fix unit tests
- remove redundancy, more cleanup
- comment out some magic_handler which are not used in the
standard library- change Syntax to extern class (some TODOs left)
- tabsify
- untypedPython -> pythonCode
- minor cleanup
- purge more untyped
- merge haxe.Resource and reactivate tests (it's soooo slow!)
- deal with "Dynamic should be Void" cases
- looks like we don't use pyFor anyway?
- disable Resource tests again (I can't work like this)
- use _callNamedUntyped
- remove Js feature cruft
- leading colon -> trailing colon
- read resources from files
- Merge pull request #27 from ousado/genpy
- remove redundant untyped
- fix indentation
- remove global bigEndian = false setting (we cannot do it like that)
- add Syntax.opPow
- use opPow to make Int32/64 implementations less retarded
- add bigEndian assignments again, guarded by #if python
- ignore current generated resource names
- deal with non-optional enum args after optional ones (closes #
frabbit/hx2python#21)- treat True and False as keywords (closes #
frabbit/hx2python#20)- fix alignment
- initial socket support
- Merge pull request #28 from ousado/genpy
- remove unnecessary Syntax -> haxe.macro.Tools dependency
- tabs
- use Codegen.default_cast for safe casts
- fix typed cast elif
- do not discard is_value when recursing into transform_expr
- add inline to builtin calls
- more inlining
- remove leftover Macros reference
- fix operator precendence
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- fix other precendence cases too
- remove obsolete
import os- use Os.makedirs for FileSystem.createDirectory
- add support for KwArgs, VarArgs, implement makeVarArgs, still
failing unit test- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- don't get rid of TCast in the transformer
- use explicit from to functions for KwArgs and VarArgs, workaround
for a possible bug- hopefully fix NativeInput
- ClassField.params is not supposed to be null
- transform TFor to TWhile
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- fields is already defined in Boot
- minor
- produce less overhead for runtime iterator calls
- there shouldn't be a postfix unop left during generation
- improve performance of runtime iterator again
- use Internal class to access internal identifiers
- Merge pull request #29 from frabbit/genpy
- more cleanup
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- add inline
- more cleanup
- cleanup std
- StringBuf, faster length, cleanup
- remove comment
- remove trash
- remove KeywordHandler
- remove untyped in EnumImpl.str
- normalize formatting (a bit)
- rewrite add_non_locals_to_func, deal with catch declarations (closes
#frabbit/hx2python#25)- Merge branch 'development' into genpy
- do not generate UInt
- remove unnecessary hasattr check in haxe.Log.trace
- use is_extern_field to determine which fields to initialize (closes #
frabbit/hx2python#26)- do interface checks for parent classes as well (closes
frabbit/hx2python#27)- remove redundant @:keep (implied by type-level @:keep)
- spam position comments in -debug mode
- Implement haxe.CallStack for Python (closes
frabbit/hx2python#28)- Merge pull request #30 from nadako/genpy
- group unused printer cases
- merge development
- merge from genpy
- use branch python-support
- cleanup untyped, cleanup Math, add native Math class
- properly handle identifiers with leading underscores like 'b', but
don't apply transformation for leading and trailing underscores like
'__iter', remove dirty hack for '__b'- fix
- add python foreach, cleanup
- minor improvements
- fix large integer issue (
frabbit/hx2python#30)- handle positive and negative infinity in trigonometry functions
- Merge branch 'development' into genpy
- add initial sys tests
- also run macro tests in bytecode mode
- Update .travis.yml
- Merge branch 'genpy' of github.com:/Simn/haxe into genpy
- Merge branch 'development' of github.com:HaxeFoundation/haxe into
genpy- remove Builtin dependency of Array and String
- remove Std -> Date dependency
- remove Boot->Math dependency
- move some base types into python.lib
- restructure python lib
- renamed and moved PyIterator => NativeIterator, PyIterable =>
NativeIterable, the underlying typedefs are now suffixed with Raw- move TB and Frame externs into python.lib.Sys
- remove python.lib.Types
- fix string concat in special circumstances
- rename StringTools and ArrayTools to NativeStrings and NativeLists
- renaming
- get rid of python.Choice
- handle keywords for nonlocal declarations
- add license header to genpy.ml
- test all targets again
- remove Types reference
- fix neko-sys invocation
- generate output directory
- add dummy FileInput.eof so sys tests compile
- add compile-python to sys tests
- add python-sys target to travis and allow failures
- properly escape invocation arguments
- always open files in binary mode, fixes some sys tests (not sure if
that's a problem)- fix
- keep track of eof state in NativeInput (this is probably a crappy
way of dealing with this, see
frabbit/hx2python#33)- rewrite FileInput and FileOutput
- fixed windows problem (saveContent), small refactoring
- support getBytes through Buffer in NativeTextInput (not sure if
that's a good implementation- python-sys tests are working
- use native json at least for parsing in the first place
- test compilation of JSONEncoder (currently missing methods)
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- remove comments from implementation
- remove commented out Syntax.callNamed implementation
File Changes
- M .gitignorehttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-0(3)
- M .travis.ymlhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-1(2)
- M Makefilehttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-2(6)
- M common.mlhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-3(17)
- M extra/ImportAll.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-4(2)
- M extra/all.hxmlhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-5(4)
- A genpy.mlhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-6(1889)
- M main.mlhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-7(19)
- M std/DateTools.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-8(4)
- M std/List.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-9(2)
- M std/StringTools.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-10(22)
- M std/haxe/CallStack.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-11(19)
- M std/haxe/Int32.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-12(6)
- M std/haxe/Int64.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-13(2)
- M std/haxe/Log.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-14(11)
- M std/haxe/Resource.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-15(35)
- M std/haxe/Serializer.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-16(24)
- M std/haxe/Timer.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-17(2)
- M std/haxe/ds/Vector.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-18(7)
- M std/haxe/io/Bytes.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-19(15)
- M std/haxe/io/BytesBuffer.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-20(3)
- M std/haxe/io/BytesData.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-21(2)
- M std/haxe/io/BytesInput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-22(3)
- M std/haxe/io/BytesOutput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-23(3)
- M std/haxe/io/Input.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-24(6)
- M std/haxe/unit/TestRunner.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-25(2)
- A std/python/Boot.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-26(452)
- A std/python/HaxeIterable.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-27(15)
- A std/python/HaxeIterator.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-28(38)
- A std/python/KwArgs.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-29(23)
- A std/python/Lib.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-30(68)
- A std/python/NativeArrayTools.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-31(17)
- A std/python/NativeIterable.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-32(20)
- A std/python/NativeIterator.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-33(19)
- A std/python/NativeStringTools.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-34(32)
- A std/python/Syntax.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-35(136)
- A std/python/VarArgs.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-36(16)
- A std/python/_std/Array.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-37(141)
- A std/python/_std/Date.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-38(148)
- A std/python/_std/EReg.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-39(257)
- A std/python/_std/Math.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-40(320)
- A std/python/_std/Reflect.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-41(160)
- A std/python/_std/Std.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-42(215)
- A std/python/_std/String.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-43(206)
- A std/python/_std/StringBuf.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-44(116)
- A std/python/_std/Sys.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-45(137)
- A std/python/_std/Type.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-46(282)
- A std/python/_std/Xml.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-47(335)
- A std/python/_std/haxe/Json.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-48(43)
- A std/python/_std/haxe/ds/IntMap.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-49(59)
- A std/python/_std/haxe/ds/ObjectMap.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-50(56)
- A std/python/_std/haxe/ds/StringMap.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-51(67)
- A std/python/_std/sys/FileSystem.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-52(80)
- A std/python/_std/sys/io/File.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-53(89)
- A std/python/_std/sys/io/FileInput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-54(105)
- A std/python/_std/sys/io/FileOutput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-55(95)
- A std/python/_std/sys/io/Process.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-56(38)
- A std/python/_std/sys/net/Host.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-57(64)
- A std/python/_std/sys/net/Socket.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-58(268)
- A std/python/internal/AnonObject.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-59(7)
- A std/python/internal/ArrayImpl.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-60(168)
- A std/python/internal/EnumImpl.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-61(23)
- A std/python/internal/HxException.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-62(12)
- A std/python/internal/HxOverrides.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-63(58)
- A std/python/internal/Internal.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-64(206)
- A std/python/internal/StringImpl.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-65(99)
- A std/python/io/FileBytesInput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-66(14)
- A std/python/io/FileBytesOutput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-67(12)
- A std/python/io/FileTextInput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-68(13)
- A std/python/io/FileTextOutput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-69(12)
- A std/python/io/IFileInput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-70(14)
- A std/python/io/IFileOutput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-71(12)
- A std/python/io/IInput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-72(43)
- A std/python/io/IOutput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-73(44)
- A std/python/io/IoTools.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-74(61)
- A std/python/io/NativeBytesInput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-75(44)
- A std/python/io/NativeBytesOutput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-76(30)
- A std/python/io/NativeInput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-77(65)
- A std/python/io/NativeOutput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-78(46)
- A std/python/io/NativeTextInput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-79(42)
- A std/python/io/NativeTextOutput.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-80(29)
- A std/python/lib/Builtin.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-81(149)
- A std/python/lib/ByteArray.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-82(23)
- A std/python/lib/Bytes.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-83(16)
- A std/python/lib/Codecs.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-84(53)
- A std/python/lib/Dict.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-85(93)
- A std/python/lib/Exceptions.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-86(355)
- A std/python/lib/FileDescriptor.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-87(6)
- A std/python/lib/FileObject.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-88(6)
- A std/python/lib/FuncTools.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-89(10)
- A std/python/lib/Glob.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-90(19)
- A std/python/lib/Inspect.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-91(20)
- A std/python/lib/Json.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-92(26)
- A std/python/lib/Math.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-93(24)
- A std/python/lib/Msvcrt.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-94(15)
- A std/python/lib/Os.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-95(77)
- A std/python/lib/PPrint.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-96(15)
- A std/python/lib/Random.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-97(14)
- A std/python/lib/Re.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-98(189)
- A std/python/lib/Set.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-99(43)
- A std/python/lib/ShUtil.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-100(18)
- A std/python/lib/Subprocess.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-101(36)
- A std/python/lib/Sys.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-102(39)
- A std/python/lib/Tempfile.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-103(11)
- A std/python/lib/Termios.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-104(23)
- A std/python/lib/ThreadLowLevel.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-105(17)
- A std/python/lib/Time.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-106(13)
- A std/python/lib/Traceback.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-107(18)
- A std/python/lib/Tty.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-108(15)
- A std/python/lib/Tuple.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-109(81)
- A std/python/lib/datetime/DateTime.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-110(45)
- A std/python/lib/datetime/TimeDelta.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-111(22)
- A std/python/lib/datetime/Timezone.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-112(11)
- A std/python/lib/datetime/TzInfo.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-113(11)
- A std/python/lib/io/BufferedIOBase.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-114(14)
- A std/python/lib/io/BufferedRWPair.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-115(8)
- A std/python/lib/io/BufferedRandom.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-116(8)
- A std/python/lib/io/BufferedReader.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-117(10)
- A std/python/lib/io/BufferedWriter.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-118(8)
- A std/python/lib/io/BytesIO.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-119(13)
- A std/python/lib/io/FileIO.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-120(10)
- A std/python/lib/io/IOBase.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-121(24)
- A std/python/lib/io/RawIOBase.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-122(13)
- A std/python/lib/io/StringIO.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-123(17)
- A std/python/lib/io/TextIOBase.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-124(16)
- A std/python/lib/json/JSONEncoder.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-125(9)
- A std/python/lib/net/Address.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-126(4)
- A std/python/lib/net/Socket.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-127(401)
- A std/python/lib/os/Path.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-128(68)
- A std/python/lib/subprocess/Popen.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-129(80)
- A std/python/lib/threading/Thread.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-130(11)
- A std/python/lib/xml/etree/ElementTree.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-131(58)
- M tests/RunTravis.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-132(23)
- A tests/sys/compile-python.hxmlhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-133(2)
- M tests/sys/compile.hxmlhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-134(3)
- M tests/sys/src/Main.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-135(1)
- A tests/sys/src/TestSys.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-136(28)
- M tests/unit/Test.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-137(5)
- A tests/unit/TestPython.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-138(265)
- M tests/unit/TestXML.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-139(2)
- A tests/unit/compile-python.hxmlhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-140(3)
- M tests/unit/compile.hxmlhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-141(1)
- M tests/unit/unitstd/DateTools.unit.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-142(2)
- M tests/unit/unitstd/StringTools.unit.hxhttps://github.com/HaxeFoundation/haxe/pull/2924/files#diff-143(2)
Patch Links:
- https://github.com/HaxeFoundation/haxe/pull/2924.patch
- https://github.com/HaxeFoundation/haxe/pull/2924.diff
—
Reply to this email directly or view it on GitHubhttps://github.com/HaxeFoundation/haxe/pull/2924
.
David Elahee
|
Awesome :) 2014-04-27 19:24 GMT+02:00 Simon Krajewski notifications@github.com:
David Elahee |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Justinfront
Apr 27, 2014
Contributor
This is really good news.
Simon Krajewski:
This pull request adds the
-python <file>command, allowing compilation of Haxe programs to python 3.The implementation passes the Haxe unit tests as well as several other projects we tested.
Modification to the Haxe core are minimal:
- common.ml: add Python as a target along with its configuration
- main.ml: add the
-pythoncommand and handle Python as a target where required- Makefile: add genpy module
- the rest of the implementation is in the file genpy.ml
Standard library files are modified where required, mostly by adding
#if pythonsections with implementations. Additions include various files understd/pythonwith the following structure:
- std/python: Various types which can be freely used by users.
- std/python/internal: Special Haxe runtime types to help with Haxe conformance.
- std/python/io: IO helper which are used by the Haxe IO API.
- std/python/lib: Externs for the python standard library.
Missing are some implementations in sys.net and everything in sys.db. We will add that a bit later.
You can merge this Pull Request by running:git pull https://github.com/Simn/haxe genpy
Or you can view, comment on it, or merge it online at:
-- Commit Summary --
- let's try it like this
- add Sys dummy fields
- add @:coreApi to Math
- add @:coreApi to Array
- merge DateTools
- add @:coreApi to EReg
- remove Lambda
- merge Serializer
- merge List
- merge StringTools
- found the FileSystem implementation
- implement most of Sys
- Sys fixes
- add basic sys tests
- list all cases explicit in transform1, fix minor do while problem
- Merge pull request #23 from frabbit/genpy
- enable increment/decrement optimization
- Merge pull request #24 from frabbit/genpy
- put parenthesis around not expr like (not expr) to avoid binding errors
- it's 'Not' not 'OpNot'
- Merge pull request #25 from frabbit/genpy
- improve code readability (whitespace removed)
- ensure operator precedence
- Merge pull request #26 from frabbit/genpy
- add list to keywords
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- don't handle keywords if function is extern, add keyword test
- initialize bigEndian
- remove redundant newlines
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- purge more whitespaces
- remove whitespace between static inits
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- remove junk
- deal with FDynamic and FAnon access on String.toLower/UpperCase
- remove some unecessary tabs
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- add very basic File operations (Bytes are still missing)
- implemented python based Bytes, get getBytes and saveBytes working
- fix ba should be buf
- use default for file open buffering
- add Utils module
- actually init the Transformer
- use read(-1) instead of readall()
- use Reflect.field/setField on dynamic field access
- remove -cmd from compile-python.hxml
- minor
- cleanup some circular dependencies
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- implement keywordhandler with python types
- minor cleanup
- move KeywordHandler functions to Reflect directly
- fix reflection of core type fields paritally
- reflect on all fields of String and Array, use Macro to hide python specific field access/call, move all of string and array implementation to impl classes
- whitespace cleanup
- remove obsolete FDynamic match cases
- move println implementation to python.Lib
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- quick fix for print/println
- add = None if non-optional arguments follow optional ones (closes frabbit/hx2python#13)
- add getChar support, flush in Lib.print and Lib.println
- python 3.2 compatible getChar
- it's msvcrt not msvrt
- typo fix
- removed trace
- rethrow the error if getchar doesn't work
- msvcrt.getchar returns an int
- getchar returns bytes
- print char in getChar
- implement systemName and use it in getChar
- add Sys.cpuTime
- put env should change the real environment
- it's Os not Sys
- Merge branch 'development' into genpy
- in progress: trying to get input and output working
- try to get Process working (in progress)
- fixed Process (at least my small test is working)
- move Tools content to StringImpl
- remove Debug.hx
- format
- use Reflect.field for closure access on String and Array
- fix static init order
- fix generation order of statics again
- cleanup dependencies (first run)
- cleanup imports
- minor
- merge development
- they don't make sense for python currently
- test polygonal-ds
- run python -V on travis (and fix some other things)
- try using python version key in .travis.yml
- Revert "try using python version key in .travis.yml"
- use python3 command
- Merge branch 'development' of github.com:HaxeFoundation/haxe into genpy
- init not necessary for builtin
- delegate more python syntax to Macros class (rename Macros to Syntax is the next step
- rename python.Macros to python.Syntax
- add print_params_named to print named functions calls like sort(key=my_key_func)
- support leading colon syntax like a[1:]
- get rid of dirty python__whatever syntax in some classes
- get rid of untyped code in Sys
- no need for preCode anymore
- remove old code
- remove Macros class
- support native assign
- more cleanup
- a little bit more cleanup, but we should get rid of HxOverrides if possible
- allow closure creation on extern static inline methods (closes #2813)
- remove sys.py
- remove python special case in TestMisc
- we don't need casts in python and we don't have to handle the inner expr with is_value=true
- return some proper types if possible
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- get rid of some HxOverrides
- some minor fixes, added some comments that we have to deal with field access on anons in general
- minor
- inline is not necessary
- move array get and set to ArrayImpl
- rename array set and get, next step TArray on lists should directly call ArrayImpl
- a little bit of Reflect cleanup
- cleanup Type
- fix unit tests
- remove redundancy, more cleanup
- comment out some magic_handler which are not used in the standard library
- change Syntax to extern class (some TODOs left)
- tabsify
- untypedPython -> pythonCode
- minor cleanup
- purge more untyped
- merge haxe.Resource and reactivate tests (it's soooo slow!)
- deal with "Dynamic should be Void" cases
- looks like we don't use pyFor anyway?
- disable Resource tests again (I can't work like this)
- use _callNamedUntyped
- remove Js feature cruft
- leading colon -> trailing colon
- read resources from files
- Merge pull request #27 from ousado/genpy
- remove redundant untyped
- fix indentation
- remove global bigEndian = false setting (we cannot do it like that)
- add Syntax.opPow
- use opPow to make Int32/64 implementations less retarded
- add bigEndian assignments again, guarded by #if python
- ignore current generated resource names
- deal with non-optional enum args after optional ones (closes #frabbit/hx2python#21)
- treat True and False as keywords (closes #frabbit/hx2python#20)
- fix alignment
- initial socket support
- Merge pull request #28 from ousado/genpy
- remove unnecessary Syntax -> haxe.macro.Tools dependency
- tabs
- use Codegen.default_cast for safe casts
- fix typed cast elif
- do not discard is_value when recursing into transform_expr
- add inline to builtin calls
- more inlining
- remove leftover Macros reference
- fix operator precendence
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- fix other precendence cases too
- remove obsolete
import os- use Os.makedirs for FileSystem.createDirectory
- add support for KwArgs, VarArgs, implement makeVarArgs, still failing unit test
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- don't get rid of TCast in the transformer
- use explicit from to functions for KwArgs and VarArgs, workaround for a possible bug
- hopefully fix NativeInput
- ClassField.params is not supposed to be null
- transform TFor to TWhile
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- fields is already defined in Boot
- minor
- produce less overhead for runtime iterator calls
- there shouldn't be a postfix unop left during generation
- improve performance of runtime iterator again
- use Internal class to access internal identifiers
- Merge pull request #29 from frabbit/genpy
- more cleanup
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- add inline
- more cleanup
- cleanup std
- StringBuf, faster length, cleanup
- remove comment
- remove trash
- remove KeywordHandler
- remove untyped in EnumImpl.str
- normalize formatting (a bit)
- rewrite add_non_locals_to_func, deal with catch declarations (closes #frabbit/hx2python#25)
- Merge branch 'development' into genpy
- do not generate UInt
- remove unnecessary hasattr check in haxe.Log.trace
- use is_extern_field to determine which fields to initialize (closes #frabbit/hx2python#26)
- do interface checks for parent classes as well (closes frabbit/hx2python#27)
- remove redundant @:keep (implied by type-level @:keep)
- spam position comments in -debug mode
- Implement haxe.CallStack for Python (closes frabbit/hx2python#28)
- Merge pull request #30 from nadako/genpy
- group unused printer cases
- merge development
- merge from genpy
- use branch python-support
- cleanup untyped, cleanup Math, add native Math class
- properly handle identifiers with leading underscores like 'b', but don't apply transformation for leading and trailing underscores like '__iter', remove dirty hack for '__b'
- fix
- add python foreach, cleanup
- minor improvements
- fix large integer issue (frabbit/hx2python#30)
- handle positive and negative infinity in trigonometry functions
- Merge branch 'development' into genpy
- add initial sys tests
- also run macro tests in bytecode mode
- Update .travis.yml
- Merge branch 'genpy' of github.com:/Simn/haxe into genpy
- Merge branch 'development' of github.com:HaxeFoundation/haxe into genpy
- remove Builtin dependency of Array and String
- remove Std -> Date dependency
- remove Boot->Math dependency
- move some base types into python.lib
- restructure python lib
- renamed and moved PyIterator => NativeIterator, PyIterable => NativeIterable, the underlying typedefs are now suffixed with Raw
- move TB and Frame externs into python.lib.Sys
- remove python.lib.Types
- fix string concat in special circumstances
- rename StringTools and ArrayTools to NativeStrings and NativeLists
- renaming
- get rid of python.Choice
- handle keywords for nonlocal declarations
- add license header to genpy.ml
- test all targets again
- remove Types reference
- fix neko-sys invocation
- generate output directory
- add dummy FileInput.eof so sys tests compile
- add compile-python to sys tests
- add python-sys target to travis and allow failures
- properly escape invocation arguments
- always open files in binary mode, fixes some sys tests (not sure if that's a problem)
- fix
- keep track of eof state in NativeInput (this is probably a crappy way of dealing with this, see frabbit/hx2python#33)
- rewrite FileInput and FileOutput
- fixed windows problem (saveContent), small refactoring
- support getBytes through Buffer in NativeTextInput (not sure if that's a good implementation
- python-sys tests are working
- use native json at least for parsing in the first place
- test compilation of JSONEncoder (currently missing methods)
- Merge branch 'genpy' of github.com:Simn/haxe into genpy
- remove comments from implementation
- remove commented out Syntax.callNamed implementation
-- File Changes --
M .gitignore (3) M .travis.yml (2) M Makefile (6) M common.ml (17) M extra/ImportAll.hx (2) M extra/all.hxml (4) A genpy.ml (1889) M main.ml (19) M std/DateTools.hx (4) M std/List.hx (2) M std/StringTools.hx (22) M std/haxe/CallStack.hx (19) M std/haxe/Int32.hx (6) M std/haxe/Int64.hx (2) M std/haxe/Log.hx (11) M std/haxe/Resource.hx (35) M std/haxe/Serializer.hx (24) M std/haxe/Timer.hx (2) M std/haxe/ds/Vector.hx (7) M std/haxe/io/Bytes.hx (15) M std/haxe/io/BytesBuffer.hx (3) M std/haxe/io/BytesData.hx (2) M std/haxe/io/BytesInput.hx (3) M std/haxe/io/BytesOutput.hx (3) M std/haxe/io/Input.hx (6) M std/haxe/unit/TestRunner.hx (2) A std/python/Boot.hx (452) A std/python/HaxeIterable.hx (15) A std/python/HaxeIterator.hx (38) A std/python/KwArgs.hx (23) A std/python/Lib.hx (68) A std/python/NativeArrayTools.hx (17) A std/python/NativeIterable.hx (20) A std/python/NativeIterator.hx (19) A std/python/NativeStringTools.hx (32) A std/python/Syntax.hx (136) A std/python/VarArgs.hx (16) A std/python/_std/Array.hx (141) A std/python/_std/Date.hx (148) A std/python/_std/EReg.hx (257) A std/python/_std/Math.hx (320) A std/python/_std/Reflect.hx (160) A std/python/_std/Std.hx (215) A std/python/_std/String.hx (206) A std/python/_std/StringBuf.hx (116) A std/python/_std/Sys.hx (137) A std/python/_std/Type.hx (282) A std/python/_std/Xml.hx (335) A std/python/_std/haxe/Json.hx (43) A std/python/_std/haxe/ds/IntMap.hx (59) A std/python/_std/haxe/ds/ObjectMap.hx (56) A std/python/_std/haxe/ds/StringMap.hx (67) A std/python/_std/sys/FileSystem.hx (80) A std/python/_std/sys/io/File.hx (89) A std/python/_std/sys/io/FileInput.hx (105) A std/python/_std/sys/io/FileOutput.hx (95) A std/python/_std/sys/io/Process.hx (38) A std/python/_std/sys/net/Host.hx (64) A std/python/_std/sys/net/Socket.hx (268) A std/python/internal/AnonObject.hx (7) A std/python/internal/ArrayImpl.hx (168) A std/python/internal/EnumImpl.hx (23) A std/python/internal/HxException.hx (12) A std/python/internal/HxOverrides.hx (58) A std/python/internal/Internal.hx (206) A std/python/internal/StringImpl.hx (99) A std/python/io/FileBytesInput.hx (14) A std/python/io/FileBytesOutput.hx (12) A std/python/io/FileTextInput.hx (13) A std/python/io/FileTextOutput.hx (12) A std/python/io/IFileInput.hx (14) A std/python/io/IFileOutput.hx (12) A std/python/io/IInput.hx (43) A std/python/io/IOutput.hx (44) A std/python/io/IoTools.hx (61) A std/python/io/NativeBytesInput.hx (44) A std/python/io/NativeBytesOutput.hx (30) A std/python/io/NativeInput.hx (65) A std/python/io/NativeOutput.hx (46) A std/python/io/NativeTextInput.hx (42) A std/python/io/NativeTextOutput.hx (29) A std/python/lib/Builtin.hx (149) A std/python/lib/ByteArray.hx (23) A std/python/lib/Bytes.hx (16) A std/python/lib/Codecs.hx (53) A std/python/lib/Dict.hx (93) A std/python/lib/Exceptions.hx (355) A std/python/lib/FileDescriptor.hx (6) A std/python/lib/FileObject.hx (6) A std/python/lib/FuncTools.hx (10) A std/python/lib/Glob.hx (19) A std/python/lib/Inspect.hx (20) A std/python/lib/Json.hx (26) A std/python/lib/Math.hx (24) A std/python/lib/Msvcrt.hx (15) A std/python/lib/Os.hx (77) A std/python/lib/PPrint.hx (15) A std/python/lib/Random.hx (14) A std/python/lib/Re.hx (189) A std/python/lib/Set.hx (43) A std/python/lib/ShUtil.hx (18) A std/python/lib/Subprocess.hx (36) A std/python/lib/Sys.hx (39) A std/python/lib/Tempfile.hx (11) A std/python/lib/Termios.hx (23) A std/python/lib/ThreadLowLevel.hx (17) A std/python/lib/Time.hx (13) A std/python/lib/Traceback.hx (18) A std/python/lib/Tty.hx (15) A std/python/lib/Tuple.hx (81) A std/python/lib/datetime/DateTime.hx (45) A std/python/lib/datetime/TimeDelta.hx (22) A std/python/lib/datetime/Timezone.hx (11) A std/python/lib/datetime/TzInfo.hx (11) A std/python/lib/io/BufferedIOBase.hx (14) A std/python/lib/io/BufferedRWPair.hx (8) A std/python/lib/io/BufferedRandom.hx (8) A std/python/lib/io/BufferedReader.hx (10) A std/python/lib/io/BufferedWriter.hx (8) A std/python/lib/io/BytesIO.hx (13) A std/python/lib/io/FileIO.hx (10) A std/python/lib/io/IOBase.hx (24) A std/python/lib/io/RawIOBase.hx (13) A std/python/lib/io/StringIO.hx (17) A std/python/lib/io/TextIOBase.hx (16) A std/python/lib/json/JSONEncoder.hx (9) A std/python/lib/net/Address.hx (4) A std/python/lib/net/Socket.hx (401) A std/python/lib/os/Path.hx (68) A std/python/lib/subprocess/Popen.hx (80) A std/python/lib/threading/Thread.hx (11) A std/python/lib/xml/etree/ElementTree.hx (58) M tests/RunTravis.hx (23) A tests/sys/compile-python.hxml (2) M tests/sys/compile.hxml (3) M tests/sys/src/Main.hx (1) A tests/sys/src/TestSys.hx (28) M tests/unit/Test.hx (5) A tests/unit/TestPython.hx (265) M tests/unit/TestXML.hx (2) A tests/unit/compile-python.hxml (3) M tests/unit/compile.hxml (1) M tests/unit/unitstd/DateTools.unit.hx (2) M tests/unit/unitstd/StringTools.unit.hx (2)-- Patch Links --
https://github.com/HaxeFoundation/haxe/pull/2924.patch
https://github.com/HaxeFoundation/haxe/pull/2924.diff
Reply to this email directly or view it on GitHub:
#2924
|
This is really good news. Simon Krajewski:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Awesome!!! Congrats! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
fponticelli
Apr 27, 2014
Member
Indeed, exceptional!
On Sun, Apr 27, 2014 at 3:54 PM, Cauê Waneck notifications@github.comwrote:
Awesome!!! Congrats!
—
Reply to this email directly or view it on GitHubhttps://github.com/HaxeFoundation/haxe/pull/2924#issuecomment-41510574
.
|
Indeed, exceptional! On Sun, Apr 27, 2014 at 3:54 PM, Cauê Waneck notifications@github.comwrote:
|
added a commit
that referenced
this pull request
Apr 28, 2014
ncannasse
merged commit b135351
into
HaxeFoundation:development
Apr 28, 2014
1 check passed
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Approved, thanks ! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Foggalong
commented
May 2, 2014
|
I think that's the most commits I've seen in one merge. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@frabbit are these getter functions public intentionally? |
Simn commentedApr 27, 2014
This pull request adds the
-python <file>command, allowing compilation of Haxe programs to python 3.The implementation passes the Haxe unit tests as well as several other projects we tested.
Modification to the Haxe core are minimal:
-pythoncommand and handle Python as a target where requiredStandard library files are modified where required, mostly by adding
#if pythonsections with implementations. Additions include various files understd/pythonwith the following structure:Missing are some implementations in sys.net and everything in sys.db. We will add that a bit later.