Skip to content

Commit

Permalink
Merge commit '870e9e7331c3b525e59f3139c8ec755e510f92e6' into release/…
Browse files Browse the repository at this point in the history
…graal-vm/1.0
  • Loading branch information
ansalond committed Sep 26, 2018
2 parents b1cb6d3 + 870e9e7 commit c6aa379
Show file tree
Hide file tree
Showing 399 changed files with 14,284 additions and 11,869 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
This changelog summarizes major changes between GraalVM versions of the Python
language runtime. The main focus is on user-observable behavior of the engine.

## Version 1.0.0 RC7

* Enhance the `java` interop builtin module with introspection utility methods

## Version 1.0.0 RC6

* Support regular expression patterns built from bytes by using CPython's sre module as a fallback engine to our own
* Support LLVM 5+ for C extension modules
* Introduce native sequence storage so that e.g. Python bytes exposed to C can be mutated
* Introduce lazy string concatenation to significantly speed up benchmarks where strings are concatenated repeatedly
* C-API improvements to support more scikit-learn code
* Fix our distinction between builtin functions, functions, and methods to make the classes for builtin functions equivalent to CPython
* Improve set, frozenset, and dict support
* Attach Python exceptions as cause to ImportErrors raised for C extension modules
* Update standard library to CPython 3.6.5
* Support more code object attributes
* Support constant type ids for objects that are interned on CPython
* Add collections.deque
* Document how to contribute
* Improve efficiency of generators
* Enable re-use of ASTs in multiple Contexts in the same Engine

## Version 1.0.0 RC5

* Generator expressions now properly evaluate their first iterator in the definition scope at definition time
Expand Down
8 changes: 4 additions & 4 deletions ci.jsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
overlay: "2562524065c42e18d4a5ea57e8cbf6cac6b9bdda",
overlay: "934f7a99e60cbc8d0affd873805c057b576f3709",

// ======================================================================================================
//
Expand Down Expand Up @@ -45,8 +45,8 @@
//
// ------------------------------------------------------------------------------------------------------
local utils = {
download: function(name, version, platformspecific = true)
{name: name, version: version, platformspecific: platformspecific},
download: function(name, version, platformSpecific = true)
{name: name, version: version, platformspecific: platformSpecific},

getValue: function(object, field)
if (!std.objectHas(object, field)) then
Expand Down Expand Up @@ -127,7 +127,7 @@

local labsjdk8Mixin = {
downloads +: {
JAVA_HOME: utils.download("labsjdk", "8u172-jvmci-0.46"),
JAVA_HOME: utils.download("labsjdk", "8u172-jvmci-0.48"),
EXTRA_JAVA_HOMES : { pathlist: [utils.download("oraclejdk", "11+20")] },
},
environment +: {
Expand Down
35 changes: 35 additions & 0 deletions doc/INTEROP.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,41 @@ def python_method():
return "Hello from Python!"
```

Finally, to interoperate with Java (only when running on the JVM), you can use
the `java` module:
```python
import java
BigInteger = java.type("java.math.BigInteger")
myBigInt = BigInteger(42)
myBigInt.shiftLeft(128) # public Java methods can just be called
myBigInt["not"]() # Java method names that are keywords in
# Python can be accessed using "[]"
byteArray = myBigInt.toByteArray()
print(list(byteArray)) # Java arrays can act like Python lists
```

In addition to the `type` builtin method, the `java` module, exposes the following
methods as well:

Builtin | Specification
--- | ---
`instanceof(obj, class)` | returns `True` if `obj` is an instance of `class` (`class` must be a foreign object class)
`is_function(obj)` | returns `True` if `obj` is a Java host language function wrapped using Truffle interop
`is_object(obj)` | returns `True` if `obj` if the argument is Java host language object wrapped using Truffle interop
`is_symbol(obj)` | returns `True` if `obj` if the argument is a Java host symbol, representing the constructor and static members of a Java class, as obtained by `java.type`

```python
import java
ArrayList = java.type('java.util.ArrayList')
my_list = ArrayList()
print(java.is_symbol(ArrayList)) # prints True
print(java.is_symbol(my_list)) # prints False, my_list is not a Java host symbol
print(java.is_object(ArrayList)) # prints True, symbols are also host objects
print(java.is_function(my_list.add))# prints True, the add method of ArrayList
print(java.instanceof(my_list, ArrayList)) # prints True
```


#### Python responses to Truffle interop messages

###### READ
Expand Down
76 changes: 0 additions & 76 deletions graalpython/benchmarks/src/benchmarks/binarytrees.py

This file was deleted.

94 changes: 0 additions & 94 deletions graalpython/benchmarks/src/benchmarks/binarytrees3t.py

This file was deleted.

97 changes: 0 additions & 97 deletions graalpython/benchmarks/src/benchmarks/bm-ai.py

This file was deleted.

Loading

0 comments on commit c6aa379

Please sign in to comment.