Commit Graph

758 Commits

Author SHA1 Message Date
Jaroslav Tulach
4213bf9983
Display overriden non-default values (#7762) 2023-09-07 13:31:51 +02:00
Radosław Waśko
7d424bf8a2
Implement Table.delete_rows. (#7709)
- Closes #7238
- Aligns `update_database_table` to a more consistent and clearer API - `update_rows`.
- Adds a `truncate_table` helper function, to pair up with `drop_table`. Both are `PRIVATE` for now.
- Adds tests for NULLs in keys in `update_rows` and `delete_rows`.
- The behaviour is sometimes unexpected, so instead these fail with `Null_Values_In_Key_Columns`.
- Adds a workaround for https://github.com/oracle/graal/issues/7359
- Adds a workaround for a related bug where a stack frame has no name (its `rootNode.getName() == null`).
- I could not track down this bug to provide a neat repro.
2023-09-07 11:07:53 +00:00
Dmitry Bushev
a1f2560491
Fix re-exports of type constructors (#7724)
close #7674

Changelog:
- fix: setting reexport field when serializing the library
2023-09-06 11:02:21 +00:00
Jaroslav Tulach
ab1c1a4c12
Delay check of suspended arguments until they are about to be computed (#7727) 2023-09-06 09:34:12 +02:00
Hubert Plociniczak
8a60bc6dcd
Replace a custom logger with off the shelf implementation (#7559)
This change replaces Enso's custom logger with an existing, mostly off the shelf logging implementation. The change attempts to provide a 1:1 replacement for the existing solution while requiring only a minimal logic for the initialization.

Loggers are configured completely via `logging-server` section in `application.conf` HOCON file, all initial logback configuration has been removed. This opens up a lot of interesting opportunities because we can benefit from all the well maintained slf4j implementations without being to them in terms of functionality.

Most important differences have been outlined in `docs/infrastructure/logging.md`.

# Important Notes
Addresses:
- #7253
- #6739
2023-09-04 09:40:16 +00:00
Radosław Waśko
87ce78615a
Change layout of local library search path in order to be able to move Round_Spec.enso back to Tests (#7634)
- Closes #7633
- Moves `Round_Spec.enso` from published `Standard.Test` into our `test/Tests` project; the `Table_Tests` that depend on it, simply `import enso_dev.Tests`.
- Changes the layout of the local libraries directory:
- It used to be `root/<namespace>/<name>`.
- Now it is `root/<dir>` - the namespace and name are now read from `package.yaml` instead.
- Adds the parent directory of the current project to the default `ENSO_LIBRARY_PATH`.
- It is treated as a secondary path, so the default `ENSO_HOME/lib` still takes precedence.
- This allows projects to reference and load 'sibling' projects easily - the only requirement is for the project to enable `prefer-local-libraries: true` or add the other local project to its edition. The edition resolution logic is **not changed**.
2023-09-01 20:20:04 +00:00
Jaroslav Tulach
6deaf80a87
Standardization of Vector.sort array access (#7697)
Inspired by #6361 - let's use `ArrayLikeXyzNode` instead of `InteropLibrary`.
2023-09-01 08:07:41 +00:00
Jaroslav Tulach
1437a671e1
Introducing generic Any.to type conversion method (#7704) 2023-09-01 08:05:48 +02:00
Hubert Plociniczak
24f263b20b
Towards shallow nesting in IR (#7681)
Refactoring deeply nested IR classes to shallow nesting.
Fixes #7017

# Important Notes
It's a big PR but fairly consistent. Split multiple hierarchy levels into subpackages.
2023-08-31 15:42:53 +00:00
Dmitry Bushev
eefe74ed93
When opening the project for a second time suggestion database is not sent (#7699)
close #7413

Changelog:
- update: the language server listens for the client disconnection event and invalidates the suggestions index

# Important Notes
The component browser contains suggestion entries after the refresh


https://github.com/enso-org/enso/assets/357683/bcebb8bf-e09f-4fb0-86cf-95ced58413f3
2023-08-31 14:06:58 +00:00
Jaroslav Tulach
b8edf6a358
Removing references to Builtins from Compiler (#7666) 2023-08-27 17:24:51 +02:00
Jaroslav Tulach
dd7ab1da38
Avoid _ after . (#7657) 2023-08-26 08:02:20 +02:00
Jaroslav Tulach
6461e20870
Special support for Python Date/Time/Zone interop (#7617) 2023-08-25 10:27:16 +02:00
Jaroslav Tulach
59a83030ed
Turn abnormal CompilerError into regular Panic (#7651) 2023-08-25 08:29:18 +02:00
Jaroslav Tulach
20e18d22df
More descriptive function information (#7629)
Fixes #7359 by printing more information about the function including partially applied arguments and over-saturated arguments.
2023-08-24 18:04:08 +00:00
Dmitry Bushev
5dc2c4c5fd
Notification about the project rename action (#7613)
close #7604

After moving the rename action to the dashboard, IDE is unaware of the new project name. PR implements a new `refactoring/projectRenamed` notification that is sent from the server to clients and informs them about the changed project name.

# Important Notes
https://github.com/enso-org/enso/assets/357683/7c62726d-217e-4e69-8e48-568e0b7b8c34
2023-08-22 11:32:46 +00:00
Jaroslav Tulach
a2946d2d27
Allow Java Enums in "case of" branches (#7607)
Fixes #7551 by looking up static symbols of a `JavaClass` polyglot object.
2023-08-21 15:12:57 +00:00
Jaroslav Tulach
e224eb350a
Eliminate compile time dependency on runtime-language-epb (#7611) 2023-08-21 05:31:39 +02:00
Jaroslav Tulach
aa0413e5a2
Use only Type instances as keys for State (#7585) 2023-08-16 15:54:17 +02:00
Jaroslav Tulach
7a272ec152
Encapsulating array-like data and operations into a single package (#7544) 2023-08-15 13:00:47 +02:00
GregoryTravis
d3436fae70
Implement Number.round as a builtin (#7460) 2023-08-14 15:43:39 +00:00
Jaroslav Tulach
f1c8c0b42b
Avoid using a (warnings) Library on this (#7525)
While investigating behavior of
```
sbt:std-benchmarks> withDebug benchOnly --dumpGraphs -- Vector_Operations.Max_Stat
```
in IGV I realized there is a deep chain of nodes when reading an element of `Vector` related to work with warnings. There is an invocation of `WarningsLibrary` on `this` - that's probably unnecessary as we know how it is going to resolve. This PR skips such one level of indirection by directly delegating to `this.storage`.

However I haven't seen any effect of this change on peak performance. The library overhead seems to disappear. Anyway I wanted to bring this finding to your attention and perform independent measurement on our CI server.
2023-08-14 15:09:57 +00:00
Dmitry Bushev
b7ab6911ff
Renaming Variable or Function Support (#7515)
close #7389



Changelog:
- add: `refactoring/renameSymbol` request to rename locals or module methods
2023-08-10 21:16:33 +00:00
Jaroslav Tulach
05e8aade1f
Exclusive context policy ensures EnsoContext.get returns compilation constant (#7493)
Fixes #6809 by giving up on any attempt to share `Node` among multiple `Context` via sharing a single `Engine`.
2023-08-08 09:18:38 +00:00
Jaroslav Tulach
3b3dbc352d
Convert no such method Panic to UnknownIdentifierException (#7487) 2023-08-07 14:58:08 +02:00
Jaroslav Tulach
9e9cf0b2ed
Adopting GraalVM's support for BigInteger (#7420)
Fixes #7213 by reacting to new `isBigInteger` and `asBigInteger` messages. Adjusts tests to require `BigInteger` when appropriate. `EnsoBigInteger` no longer extends `Number`. Enso tests to come.
2023-08-03 10:49:16 +00:00
Radosław Waśko
c61c741476
Respect database backend naming limitations when generating table/column names and validate user-provided names to avoid silent name clashes; process JDBC warnings reported from backends (#7428)
- Closes #5951
- Ensures any SQL warnings reported by the database through the JDBC driver are processed and forwarded to the user.
- These warnings show issues like the implicit name truncation that this PR is also solving. It's good to make sure they are visible as they can help avoid and understand unexpected problems. They should not show up in most standard workflows.
- Adds simple history to our REPL.
2023-08-03 09:44:27 +00:00
Jaroslav Tulach
c4d90ae6ff
Verify Python date can be used where Enso date (#7396)
Verifies #7387 by running existing suites with various Python objects.
2023-07-28 14:17:42 +00:00
Dmitry Bushev
80c4b1ca06
Allow users to give a project other than Upper_Snake_Case name (#7397)
close #6356

Allow arbitrary names for user projects.

# Important Notes
https://github.com/enso-org/enso/assets/357683/55a3b660-af23-4b09-959b-eac515766788
2023-07-28 13:44:39 +00:00
Jaroslav Tulach
14afa9a843
Check for PanicSentinel in SequenceLiteralNode (#7385)
Fixes #7245.

![Vector with a panic](https://github.com/enso-org/enso/assets/26887752/eed01c6c-5492-4cc6-bd4f-63ba761db010)

The above picture shows that the _vector problem_ reported by #7245 is fixed.

# Important Notes
The fix modifies `SequenceLiteralNode` to recognize `PanicSentinel` and `throw` it as common in other places (like invoke function node, etc.).
2023-07-28 08:33:59 +00:00
Jaroslav Tulach
f2c46428bd
Moving PackageRepository.Default into its own EnsoPackageRepository (#7395) 2023-07-26 09:59:56 +02:00
Jaroslav Tulach
b9a6e35096
Simplifying builtins type system support (#7344) 2023-07-24 13:27:09 +02:00
Jaroslav Tulach
34c63e3b11
Ascribed types & atom_with_hole (#7348) 2023-07-24 07:02:58 +02:00
James Dunkerley
88f32d9b2a
Various small tickets... (#7367)
- Added `Text.length` into Text class so CB lists the built in.
- Added `File.starts_with` and tests for the built in method.
- Add `to_js_object` and `to_display_text` to `Regex`.
![image](https://github.com/enso-org/enso/assets/4699705/3b197c94-9c49-4bc5-a2cc-ce53b917942e)
- Add `to_js_object` and `to_display_text` to `Match`.
![image](https://github.com/enso-org/enso/assets/4699705/962ec4f2-324d-4f10-8ec0-932b093c6729)
- Remove the `bit_shift_l` alias from the built-ins.
- Add test and Enso wrapper for `Text.is_normalized`.
2023-07-23 09:04:11 +00:00
Jaroslav Tulach
76457b0d58
Yield UnclosedTextLiteral syntax errors (#7340)
Fixes #7279 by detecting missing `getClose()` and yielding an `UnclosedTextLiteral`.

# Important Notes
Special care must be taken for _text blocks_. They have `null` `getClose()`.
2023-07-21 11:37:30 +00:00
Pavel Marek
cab6968340
Update GraalVM to 17.0.7 (23.0.0 JDK17) (#7176)
- Previous GraalVM update: https://github.com/enso-org/enso/pull/6750

Removed warnings:
- Remove deprecated `ConditionProfile.createCountingProfile()`.
- Add `@Shared` to some `@Cached` parameters (Truffle now emits warnings about potential `@Share` usage).
- Specialization method names should not start with execute
- Add limit attribute to some specialization methods
- Add `@NeverDefault` for some cached initializer expressions
- Add `@Idempotent` or `@NonIdempotent` where appropriate

BigInteger and potential Node inlining are tracked in follow-up issues.

# Important Notes
For `SDKMan` users:
```
sdk install java 17.0.7-graalce
sdk use java 17.0.7-graalce
```

For other users - download link can be found at https://github.com/graalvm/graalvm-ce-builds/releases/tag/jdk-17.0.7

Release notes: https://www.graalvm.org/release-notes/JDK_17/

R component was dropped from the release 23.0.0, only `python` is available to install via `gu install python`.
2023-07-20 15:11:30 +00:00
GregoryTravis
2fb5c3710b
Add Fallback to Prim_Text_Helper.compile_regex; accept Regex in Text.parse_to_table (#7297)
This PR does three related things:
- Fails more gracefully when a non-string is passed to compile_regex
- Don't pass a non-string to compile_regex
- Allow a Regex param to parse_to_table
2023-07-18 19:55:56 +00:00
Jaroslav Tulach
a80f9d68e9
ResourceManagerTest to verify resources are cleaned on ctx.close() (#7302)
Demonstration of the ideal behavior of #6472 - the test seems to be working just fine.
2023-07-17 16:23:05 +00:00
Jaroslav Tulach
e59513065d
Ascribed Type checks for a -> b function types (#7298) 2023-07-17 09:55:30 +01:00
Jaroslav Tulach
6864792653
Avoid Compiler compile time dependency on EnsoContext (#7299) 2023-07-17 09:24:22 +01:00
Pavel Marek
7264d81f2a
Builtin methods can support array-like arguments (#7235)
This PR modifies the builtin method processor such that it forbids arrays of non-primitive and non-guest objects in builtin methods. And provides a proper implementation for the builtin methods in `EnsoFile`.

- Remove last `to_array` calls from `File.enso`
2023-07-17 09:17:39 +02:00
Jaroslav Tulach
3d2c0c0154
Avoiding dependency on EnsoContext from Module and ModuleScope (#7277)
Less dependencies on `EnsoContext` - `Module` shall exist without it. `Module` is a result of a `Compiler` and shall be created before its execution - e.g. requiring `EnsoContext` (with all its runtime information) is a bit too _demanding_.

# Important Notes
The only reason why `Module` wanted `EnsoContext` was to create its (associated) `Type`. `Type`'s constructor needed a parent type and the code was asking for `Any` from the context. That's unnecessary at creation time - we can just use some constant (like `null`) and turning it into `Any` during execution. Benchmarks show that there is no slowdown doing so.
2023-07-15 09:11:28 +00:00
Jaroslav Tulach
372c2eed66
No need to depend on EnsoContext when working with PackageRepository (#7276)
On a quest to avoid dependencies on `EnsoContext` from `Compiler`. Step one. The ultimate goal is to move `Compiler` and all its `IRPasses` into a dedicated `runtime/compiler` module that could be used from #7054.
2023-07-13 17:04:57 +00:00
Radosław Waśko
620cc361ce
Add date_diff, date_add and date_part to scalar Enso date-time values. (#7273)
Followup of #7221, adding `date_diff`, `date_add` and `date_part` to scalar Enso date-time values.
2023-07-13 15:17:21 +00:00
Jaroslav Tulach
2aeef4d844
Automatically apply from conversion when runtime argument check fails (#7009) 2023-07-11 07:23:25 +01:00
Hubert Plociniczak
a140a04689
A dataflow error with warnings reports the former (#7205)
A dataflow error resulting from calling a value with warnings now
reports only the error rather than the warning.

Closes #7141.
2023-07-05 14:18:36 +02:00
James Dunkerley
4fbe7e3830
Remove Array.new and Array.copy and move Vector functions to builtins. (#7147)
- Removed Array methods: `new`, `copy` and `new_[1234]`.
- New builtins for `Vector.insert`, `Vector.remove` and `Vector.flatten`.
- Replaced `Vector_Builder` use of `Array.copy` to a `Vector.Builder` approach.
2023-07-03 12:41:41 +00:00
Hubert Plociniczak
3c93c25a5a
Reload project's config on rename (#7179)
Package's config information, once loaded, never changed. While there is typically no need for it, this was problematic when the config became out-of-sync with the filesystem, like in the case of project rename action.
In rename, the config's properties would be updated in the FS, but that would never be reflected in module's package. Therefore further compilations would continue to ask for the old namespace.

Most of the changes are cosmetic (s/`.config`/`.getConfig()`) except for the new `reloadConfig` method on `Package` that is being called in `RenameProjectCmd` handler.

Closes #7062.

# Important Notes
The reported `ExecutionFailed` error should have been mostly fixed already via #7143. This change makes sure that all the related warnings are gone as well and the compiler uses the updated namespace.
2023-07-03 09:36:19 +00:00
Pavel Marek
ebee8700ce
HashMapNode supports atoms with custom comparators (#7165)
Add proper handling for atoms with custom comparators into the hashing machinery.
2023-06-30 08:57:36 +00:00
Jaroslav Tulach
91f661fd8b
Documenting how to debug project-manager project (#7153)
```
sbt:project-manager> withDebug run --debugger
```
2023-06-29 05:55:14 +00:00