Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Builtin Types and Methods to stdlib #3363

Merged
merged 80 commits into from
May 5, 2022
Merged
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
38a2da7
Dynamically replace builtin methods with functions
hubertp Mar 25, 2022
374a94c
Deal with Polyglot split by selectively importing
hubertp Mar 29, 2022
6afa443
Move Array type out of Builtins
hubertp Apr 4, 2022
02ab5b1
Move Ref type + basic test
hubertp Apr 4, 2022
6938b2d
Move Boolean out of Builtins to std library
hubertp Apr 5, 2022
75cd43d
Drop reflection requirement for builtin methods
hubertp Apr 6, 2022
0f89f44
Use constant values to avoid typos
hubertp Apr 6, 2022
91c6432
Move Meta out of builtins
hubertp Apr 7, 2022
43840f2
Revert "Move Boolean out of Builtins to std library"
hubertp Apr 8, 2022
9822d76
wip
hubertp Apr 9, 2022
e561565
Move Any to stdlib
hubertp Apr 11, 2022
9dbfa06
Move Boolean to stdlib
hubertp Apr 11, 2022
c42b092
Missing Booleans.enso from last commit
hubertp Apr 11, 2022
fb10830
Simplify builtins metadata generation
hubertp Apr 11, 2022
fb666c1
Cleanup
hubertp Apr 12, 2022
1dc9594
Simplify resource reading
hubertp Apr 12, 2022
8ca36e8
Merge branch 'develop' into wip/hubert/shadow-definition-builtins-181…
hubertp Apr 12, 2022
a588c80
Move List to stdlib
hubertp Apr 12, 2022
d771a7f
WIP: remove hardcoded builtin types in Builtins
hubertp Apr 13, 2022
d529ad8
Workaround separate compilation problems
hubertp Apr 13, 2022
3cfdedd
Address PR review
hubertp Apr 14, 2022
8ee6654
CamelCase to Snake_Case for builtin types
hubertp Apr 14, 2022
c04f11e
Move DataflowError to stdlib
hubertp Apr 15, 2022
20f8be4
typo
hubertp Apr 15, 2022
fd094e1
Move all error types + text
hubertp Apr 19, 2022
1a2a80a
Move IO stuff
hubertp Apr 19, 2022
8e76ba8
Add missing shared test class
hubertp Apr 19, 2022
d261608
Improve runtime of tests
hubertp Apr 19, 2022
d3e5fa8
Add IO to stdlib
hubertp Apr 19, 2022
75ba97c
DRY
hubertp Apr 19, 2022
870aacd
nit
hubertp Apr 19, 2022
67dafaa
Final AtomConstructor
hubertp Apr 19, 2022
f75be8a
Move Nothing and Function to stdlib
hubertp Apr 20, 2022
f0b45a7
Nits
hubertp Apr 21, 2022
8e7e15f
Cons/Nil are no longer Builtin_Types
hubertp Apr 21, 2022
b6ae3f0
Adapt benchmark fixtures
hubertp Apr 21, 2022
870ef1a
Remove unused imports
hubertp Apr 21, 2022
70d558d
Rename local 'reverse' method in List benchmarks
hubertp Apr 21, 2022
4f1fe32
Amend benchmark with missing import
hubertp Apr 21, 2022
6cfeca0
Make benchmarks happy again
hubertp Apr 21, 2022
b6fe9cc
fix typo
hubertp Apr 21, 2022
f17d3cb
Move runtime builtin types to stdlib
hubertp Apr 22, 2022
e4037b4
Move Prim_Warning to stdlib
hubertp Apr 22, 2022
1a586d9
Builtins is dead, long live builtins
hubertp Apr 25, 2022
da040f8
Missed some test adaptation
hubertp Apr 25, 2022
4e4535e
Getting rid of Standard.Builtins mentions
hubertp Apr 25, 2022
10d1a52
Remove empty Builtins.enso references
hubertp Apr 25, 2022
5ae3289
Automatic formatting
hubertp Apr 25, 2022
69ad669
Remove extension method for unimplemented error
hubertp Apr 25, 2022
966c2f1
Merge branch 'develop' into wip/hubert/shadow-definition-builtins-181…
hubertp Apr 25, 2022
1372387
Minor adjustments to expectations
hubertp Apr 25, 2022
9a703a3
Update Changelog
hubertp Apr 25, 2022
2ddcf9f
More docs for annotation processors
hubertp Apr 25, 2022
c927582
More Standard.Builtins purge
hubertp Apr 25, 2022
f7145e8
Merge branch 'develop' into wip/hubert/shadow-definition-builtins-181…
hubertp Apr 28, 2022
1ecd317
Follow up on merge with develop
hubertp Apr 28, 2022
a384ed0
PR review re IO and Prim_Io modules
hubertp Apr 28, 2022
40ad2c7
PR review Numbers
hubertp Apr 28, 2022
23e9298
Remove builtin Ordering type
hubertp Apr 28, 2022
a33b45d
Move FIXME comment on Ref to pivotal ticket
hubertp Apr 28, 2022
0c5c19c
Remove leftover comment
hubertp Apr 28, 2022
3417b66
More cleanups, as per PR comments
hubertp Apr 28, 2022
7dc9a34
Formatting
hubertp Apr 28, 2022
3adc0ef
Remove logic to handle Any/Nothing methods
hubertp Apr 29, 2022
dc11b5a
Auto-generate Builtins Constants
hubertp Apr 29, 2022
9414fce
Test adjustments to the previous commit
hubertp May 4, 2022
fa4ca5b
Update distribution/lib/Standard/Base/0.0.0-dev/src/Error/Common.enso
hubertp May 4, 2022
cba36f3
Make formatter happy again
hubertp May 4, 2022
7bf6261
DRY
hubertp May 4, 2022
fe89bc1
Add a requested compiler assert
hubertp May 4, 2022
1c40d25
Merge branch 'develop' into wip/hubert/shadow-definition-builtins-181…
hubertp May 4, 2022
6ba1bc4
Fix tests
hubertp May 4, 2022
4fde6ba
Increase timeout to avoid FPs
hubertp May 4, 2022
b10bb8c
Turn on IR caches for tests
hubertp May 5, 2022
6f27d5e
Merge branch 'develop' into wip/hubert/shadow-definition-builtins-181…
hubertp May 5, 2022
aeeef17
Fix tests
hubertp May 5, 2022
670cad6
Merge branch 'develop' into wip/hubert/shadow-definition-builtins-181…
hubertp May 5, 2022
6c06032
Make disabling IR cache in tests configurable
hubertp May 5, 2022
c90836d
More formatting
hubertp May 5, 2022
884a7d1
Merge branch 'develop' into wip/hubert/shadow-definition-builtins-181…
hubertp May 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adapt benchmark fixtures
List is no longer a builtin so AtomFixtures need to be adapted.
Rather than constructing a list of million elements manually we just
evaluate Enso code that does that.
  • Loading branch information
hubertp committed Apr 21, 2022

Unverified

No user is associated with the committer email.
commit b6ae3f0d9a1b859d4f49c338365426f2b1ae5bd6
Original file line number Diff line number Diff line change
@@ -7,20 +7,17 @@ import org.graalvm.polyglot.Value
class AtomFixtures extends DefaultInterpreterRunner {
val million: Long = 1000000

def buildInputList(length: Long): Value = {
val builtins =
interpreterContext.executionContext.getTopScope
.getModule(Builtins.MODULE_NAME)
val nil = builtins.getConstructor("Nil")
val cons = builtins.getConstructor("Cons")
1L.to(length).foldLeft(nil.newInstance()) { case (tail, el) =>
cons.newInstance(el.asInstanceOf[Object], tail)
}
}
val millionElementList = buildInputList(million)
val millionElementList = eval(
s"""|from Standard.Base.Data.List import Cons,Nil
|from Standard.Base.Data.Number.Extensions import all
|
|main =
| res = (1.up_to $million).fold Nil (acc -> x -> Cons x acc)
| res
""".stripMargin)

val generateListCode =
"""from Standard.Builtins import all
"""from Standard.Base.Data.List import all
|
|main = length ->
| generator = acc -> i -> if i == 0 then acc else @Tail_Call generator (Cons i acc) (i - 1)
@@ -31,18 +28,18 @@ class AtomFixtures extends DefaultInterpreterRunner {
val generateList = getMain(generateListCode)

val generateListQualifiedCode =
"""from Standard.Builtins import all
"""from Standard.Base.Data.List import all
|
|main = length ->
| generator = acc -> i -> if i == 0 then acc else @Tail_Call generator (Builtins.cons i acc) (i - 1)
| generator = acc -> i -> if i == 0 then acc else @Tail_Call generator (List.cons i acc) (i - 1)
|
| res = generator Builtins.nil length
| res = generator List.nil length
| res
""".stripMargin
val generateListQualified = getMain(generateListQualifiedCode)

val reverseListCode =
"""from Standard.Builtins import all
"""from Standard.Base.Data.List import all
|
|main = list ->
| reverser = acc -> list -> case list of
@@ -55,7 +52,7 @@ class AtomFixtures extends DefaultInterpreterRunner {
val reverseList = getMain(reverseListCode)

val reverseListMethodsCode =
"""from Standard.Builtins import all
"""from Standard.Base.Data.List import all
|
|Cons.reverse = acc -> case this of
| Cons h t -> @Tail_Call t.reverse (Cons h acc)
@@ -69,7 +66,7 @@ class AtomFixtures extends DefaultInterpreterRunner {
val reverseListMethods = getMain(reverseListMethodsCode)

val sumListCode =
"""from Standard.Builtins import all
"""from Standard.Base.Data.List import all
|
|main = list ->
| summator = acc -> list -> case list of
@@ -82,7 +79,7 @@ class AtomFixtures extends DefaultInterpreterRunner {
val sumList = getMain(sumListCode)

val sumListLeftFoldCode =
"""from Standard.Builtins import all
"""from Standard.Base.Data.List import all
|
|main = list ->
| fold = f -> acc -> list -> case list of
@@ -95,7 +92,7 @@ class AtomFixtures extends DefaultInterpreterRunner {
val sumListLeftFold = getMain(sumListLeftFoldCode)

val sumListFallbackCode =
"""from Standard.Builtins import all
"""from Standard.Base.Data.List import all
|
|main = list ->
| summator = acc -> list -> case list of
@@ -108,7 +105,7 @@ class AtomFixtures extends DefaultInterpreterRunner {
val sumListFallback = getMain(sumListFallbackCode)

val sumListMethodsCode =
"""from Standard.Builtins import all
"""from Standard.Base.Data.List import all
|
|Nil.sum = acc -> acc
|Cons.sum = acc -> case this of
@@ -121,7 +118,7 @@ class AtomFixtures extends DefaultInterpreterRunner {
val sumListMethods = getMain(sumListMethodsCode)

val mapReverseListCode =
"""from Standard.Builtins import all
"""from Standard.Base.Data.List import all
|
|Nil.mapReverse = f -> acc -> acc
|Cons.mapReverse = f -> acc -> case this of
@@ -134,7 +131,7 @@ class AtomFixtures extends DefaultInterpreterRunner {
val mapReverseList = getMain(mapReverseListCode)

val mapReverseListCurryCode =
"""from Standard.Builtins import all
"""from Standard.Base.Data.List import all
|
|Nil.mapReverse = f -> acc -> acc
|Cons.mapReverse = f -> acc -> case this of