Commit Graph

1014 Commits

Author SHA1 Message Date
James Dunkerley
28bbc34257
Widget support for Data.fetch and Data.post. (#11199)
- Add `pretty` for `Date` and `Time`.
- Add constructors for `JS_Object` and `Dictionary` to the component browser.
- Add widgets to `Dictionary` methods.
![image](https://github.com/user-attachments/assets/4f6c58d5-9eb5-40e5-96c1-2e06e23051d0)
- Add conversion from Vector to Dictionary.
- Add `pair` method shorthand for `Pair.Value`.
- Created widget for `Header`.
- Added widgets for `Data.fetch` and `Data.post`.
- Added widgets for `Request_Body` constructors.
- Update the Forbidden Operation message to be friendlier.
![image](https://github.com/user-attachments/assets/eaac5def-a91f-450f-b814-d776311962e3)

Video before fixing Forbidden Message:

https://github.com/user-attachments/assets/f9c4bde4-3f0a-49f1-a3ca-a0aaa3219286
2024-09-27 18:08:12 +00:00
Kaz Wesley
289198127f
Stateless parser API (#11147)
Stateless (static) parser interface. Buffer-reuse optimization is now hidden within `Parser` implementation. Fixes #11121 and prevents similar bugs.

# Important Notes
- Also simplify `EnsoParser` API, exposing only a higher-level interface.
2024-09-27 15:58:02 +00:00
Jaroslav Tulach
2fbd0aa92b
Special treatment of PanicSentinel in CatchPanicNode (#11167)
Fixes #9402 by explicitly throwing `PanicSentinel` in `CatchPanicNode`. b89275bf2c enhances `CatchPanicNode` to provide a special treatment of `PanicSentinel` and a85c561d2a adds some tests to verify the treatment.
2024-09-26 05:34:30 +00:00
Pavel Marek
9182f91e35
engine-runner and language-server are separate JPMS modules (#10823)
* Use moduleDependencies instead of modulePath

* Fix compilation of editions

* Fix compilation of distribution-manager

* polyglot-api needs to explicitly compile module-info

* Fix compilationOrder in library-manager and edition-updater

* engine-runner-common is module

* JPMSPlugin provides default implementation of compileModuleInfo

* Remove unused setting key from JPMSUtils.compileModuleInfo

* JPMSPlugin has internalModuleDependencies and exportedModule tasks.

* Use BuildVersion instead of buildInfo

* Manual compilation of module-info.java is reported as warning

* Define org.enso.scalalibs.wrapper meta project.

* Fix module check in JPMSPlugin.

This is a fix for projects that declare `Compile /exportJars := true`

* version-output is a module

* ydoc-server uses internalModuleDependencies

* persistance is module

* engine-common uses internalModuleDependencies

* polyglot-api does not override compileModuleInfo task

* runtime-parser uses internalModuleDependencies

* edition-updater is module

* Update moduleDependencies for distribution-manager

* editions is module

* Fix some dependencies of modules

* scala-yaml is a module

* Add scala-compiler to scala-libs-wrapper

* cli depends on scala-library module

* Add dependencies for distribution-manager module

* Add some scala-library dependencies in some modules

* engine-runner uses internalModuleDependencies

* Fix module dependencies of library-manager

* Rename org.enso.scalalibs.wrapper to org.enso.scala.wrapper

* Add jsoniter-scala-macros to org.enso.scala.wrapper fat module

* Fix dependencies of some projects

* polyglot-api does not depend on truffle-api

* Fix dependencies of some projects

* runtime does not use com.google.common

* runtime is a module

* text-buffer is a module

* refactoring-utils is a module

* runtime-compiler is a module

* runtime-instrument-common is a module

* connected-lock-manager is a module

* JPMSUtils reports project name in some error messages

* Modularize some instruments

* module-info compilation is cached

* runtime-instrument-runtime-server is module

* runtime-language-epb is module

* Remove runtime-fat-jar

* engine-runner is not a fat jar

* JPMSPlugin defines exportedModuleBin task

* Redefine componentModulesPaths task

* interpreter-dsl is module

* Redefine componentModulesPaths task

* fmt sbt

* scala-libs-wrapper is a modular fat jar

* Add some module deps to org.enso.runtime

* engine-runner is not a fat jar

* Rename package in logging-config

* Rename package in logging-service

* Rename package in logging-service-logback

* Fix dependencies of exportedModuleBin task

* Mixed projects have own compileJava task

this task does not compile only module-info.java but all the java sources. So that we can see errors more easily.

When only module-info.java is compiled, the only errors that we can see are that we did not include some modules on module-path.

* Fix definition of exportedModule task.

* Remove usages of non-existing buildInfo and replace it with BuildVersion

* Fix some dependencies of org.enso.runtime module

* module-info compilation is handled directly by FrgaalCompiler

* module-info compilation is forced for projects that has only Scala sources with single module-info.java

* Fix compilation of org.enso.runtime

* manual module-info compilation is not a warning

* Rename packages in logging-utils-akka

* Create org.enso.language.server.deps.wrapper module

* language-server is module

* Creat akka-wrapper modular fat jar

* fmt

* Define common settings for modularFatJarWrapper

* Fix compilation of json-rpc-server

* Use akka and zio wrappers

* language-server depends on org.eclipse.jgit

* Fix some dependencies - update library manifests works now!

* update library manifests invokes runner directly

* buildEngineDistribution does not copy runner.jar

* Remove EngineRunnerBootLoader

* Fix compilation of std libs

* --patch-module and --add-exports are also passed to javac

* Rename package in runtime-integration-tests.

The package name org.enso.compiler clashes with the package from the module

* Remove usage of buildInfo

* FrgaalJavaCompiler can deal with non-existing module-info.java when shouldCompileModuleInfo is true.

It just generates a warning in such case as it suggests that there is something wrong with the project configuration.

* Revert AliasAnalysisTest.scala

* Fix dependencies and java cmdline options for runtime-integration-tests

* Rename test package

* runtime-integration-test depends on logging-service-logback/Test/compile

* Rename package in logging-service-logback/Test

* Fix FrgaalJavaCompiler creation for projects

* Sanitize Test/javaOptions arguments

* Sanitize Test/javaOptions arguments

* All the JPMSPlugin settings are scoped

* Remove unused sbt tasks

* modularFatJarWrapperSettings do not override javacOptions

* Resolve issue "Cannot find TestLoggerProvider" in runtime-integration-tests

* org.enso.runtime module is open

* Test that test classes are unconditionally opened and exported

* polyglot-api-macros is a module

* JPMSPlugin handles --add-opens cmdline option

* RuntimeServerTest ensures instruments are initialized

* Add some exports to org.enso.runtime.compiler

* Add instruments on module-path to runtime-integration-tests

* Replace TestLogProviderOnClassPath with TestLogProviderOnModulePath

* Replace buildInfo with BuildVersion

* Add jpms-wrapper-scalatest

* ReportLogsOnFailure is in non-modular testkit project

* Add necessary dependencies to testkit project

* Revert "Add jpms-wrapper-scalatest"

This reverts commit 732b3427a2.

* modularize filewatcher and wrap its dependencies

* Initial fix for language-server/test

* frgaal compiler setting are scoped for Compile and Test

* Rename package in language-server/test

* Exclude com.sun.jna from wrapper jars

* Rename package in library-manager-test

* testkit is an automatic module

* process-utils is module

* akka-wrapper contains akka-http

* Some fixes for library-manager-test

* Fix dependencies for akka-wrapper

* scala-libs-wrapper exports shapeless

* lang server deps wrapper exports pureconfig

* json-rpc-server requires org.slf4j

* Add some dependencies

* lang server deps wrapper exports pureconfig.generic

* language server test requires bouncycastle provider

* language server depends on cli

* directory-watcher wrapper requires org.slf4j

* WatcherAdapter logs unsuccessful initialization errors

* Fix error reporting in WatcherAdapter

* Fix rest of the language-server tests

* language-server-deps-wrapper depends on scala-libs-wrapper

* Fix rest of the language-server tests

* Missing module-info.class in an internal project is a warning, not an error

* Rename jpms-methvin-directory-watcher-wrapper to a simpler name

* compileOrder has to be specified before libraryDependencies

* exclude module-info.java from polyglot-api-macros

* Remove temporary logging in customFrgaalCompilerSettings

* Fix compilation of logging-service-logback

* Fix compilation of runtime-benchmarks

* Fix runtime-benchmarks/run

* HostClassLoader delegates to org.graalvm.polyglot class loader if org.enso.runtime is not on boot layer

* org.enso.runtime.lnaguage.epb module must be opened to allow it to be used by annnotation processor

* fmt

* Fix afetr merge

* Add module deps after merge

* Print stack trace of the uncaught exception from the annotation processor

* Remove akka-actor-typed from akka-wrapper

* runtime-instrument-common depends on slf4j

* Fix module-path for runtime-instrument-repl-debugger

* runtime-benchmarks depends on runtime-language-arrow

* --module-path is passed directly to frgaal

* Fix some module-related cmd line options for std-benchmarks

* Revert "--module-path is passed directly to frgaal"

This reverts commit da63f66a0e.

* Avoid closing of System.err when closing Context

* Avoid processing altogether when requested annotations are empty

* Pass shouldNotLimitModules opt to frgaal

* Pass module-path and add-modules options with -J prefix to frgaal

* BenchProcessor annotation processor creates its own truffle module layer

* bench-processor and benchmarks-common are modules

* fmt

* Fix after mege

* Enable JMH annotation processor

* Fix compileOrder in some projects

* Insert TruffleBoundary to QualifiedName.

This is a revert

* Fix building of engine-runner native image

* Add more deps to the native image

* Force module-info compilation in instruments.

This fixes some weird sbt bug

* Don't run engine-runner/assembly from Rust build script

* Update docs of JPMSPlugin

* fmt

* runtime-benchmarks depends on benchmarks-common module

* Fix benchmark report writing

* std-benchmarks annot processing does not take settings from runtime-benchmarks

* Suppress interpreter only warning in annotation processor

* Runtime version manager does not expect runtime.jar fat jar

* fmt

* Fix module entry point

* Move some polyglot tests to runtime-integration-tests.

Also make their output silent

* pkg has no dependency on org.graalvm.truffle

* Fix compiler dependencies test

* Rename all runtime.jar in fake releases

* Add language-server with dependencies to component dir

* No module-info.class in target dir is warning not error

* language-server does not depend on netbeans lookup uitl

* Declare LanguageServerApi service provider in module-info

* connected-lock-manager-server is JPMS module

* task-progress-notifications is module

* Add fansi-wrapper module

* Fix compilation of connected-lock-manager-server

* Define correct Test/internalModuleDependencies for project-manager

* fmt

* Fix LauncherRunnerSpec - no runtime.jar

* Add fansi-wrapper to runtime-integration-tests and runtime-benchmarks

* Fix engine-runner native image build

* Use newer JNA version - fixes running of hyperd

* DRY

* scala-compiler DRY

* fmt

* More build.sbt refactoring

* Include runtime-instrument-id-execution in engine-runner native image

* TruffleBoundary for QualifiedName.toString

* Finding a needle in a haystack

🤦

* More scala-library DRY

* more mixed-java/scala goodies

* Fix compilation of syntax-rust-definition

* Test that engine-runner does not depend on language-server

* Append rather than assign `moduleDependencies`

`++=` is less error prone than `:=`. Also discovered some unnecessary
dependencies.

* Replace : with File.pathSeparator

* [WIP] Make logging in ProjectService more verbose

* language-server/test didn't start because of missing lookup and fansi modules

* Formatting

* org.enso.cli.task.notifications needs Akka and Circe to link

* project-manager/test depends on buildEngineDistribution

* [WIP] Even more verbose logging for creating projects

* [WIP] Even more verbose logging for creating projects

* Revert "[WIP] Even more verbose logging for creating projects"

This reverts commit a7067c8472.

* Revert "[WIP] Even more verbose logging for creating projects"

This reverts commit fc6f53d4f1.

* Revert "[WIP] Make logging in ProjectService more verbose"

This reverts commit 427428e142.

* All the project with JPMSPlugin has stripped artifact names

* Revert all placeholder fake release components to runtime.jar without version

* Eliminate a cross version hack

We shouldn't be specifying Scala dependencies with a Scala cross version
in the suffix.

* Address SBT lint warnings

* Revert "Eliminate a cross version hack"

This reverts commit 8861dab288.

* logging-service-logback  is mixedJavaScalaProject

* fmt

* Stripped artifact name contains classifier.

This fixes tests as those were named like `artifact-tests.jar`.

* Don't use LocalProject unless really needed

* Add more logging when BenchProcessor fails

* logging-service-logback is not mixed project

* Work with java.io.File.getPath to avoid mixing slash and backslash on Windows

* Reapply "Eliminate a cross version hack"

This reverts commit edaa436ee8.

* Pass scalaBinaryVersion correctly

* Remove scala-compiler from the distribution

* Fix IllegalAccessErrors from serde

* typos

* License review

* fmt

* Move testLogProviderOnModulePath to TestJPMSConfiguration

* logging-service-logback is not a mixed project

---------

Co-authored-by: Jaroslav Tulach <jaroslav.tulach@enso.org>
Co-authored-by: Hubert Plociniczak <hubert.plociniczak@gmail.com>
2024-09-25 21:33:13 +02:00
Jaroslav Tulach
f37e50e87b
Propagate comparator warnings via Any.== (#11009)
Fixes #10679 by changing the return type of `EqualsXyzNode`s to `EqualsAndInfo`. This class holds the result of the comparation as well as any attached warnings. `EqualsBuiltinNode` then re-attaches the warnings, if there are any.
2024-09-25 09:48:34 +00:00
Jaroslav Tulach
37688033c8
Don't convert type to the same type (#11122) 2024-09-18 18:15:58 +02:00
Hubert Plociniczak
862100c7c0
More info when we fail to log AssertError (#11113)
Motivation:
```
Caused by: java.lang.AssertionError: No polyglot context is entered. A language or context reference must not be used if there is no polyglot context entered.
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotFastThreadLocals.assertValidGet(PolyglotFastThreadLocals.java:481)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotFastThreadLocals$ContextReferenceImpl.get(PolyglotFastThreadLocals.java:513)
 	at org.enso.runtime/org.enso.interpreter.runtime.EnsoContext.get(EnsoContext.java:246)
	at org.enso.runtime/org.enso.interpreter.runtime.error.PanicException.computeMessage(PanicException.java:90)
```
2024-09-17 23:20:14 +02:00
Dmitry Bushev
9179dff89f
Move execution environment from State to EnsoContext (#11075)
related #10719

Changelog:
- refactor: move execution environment from `State` to `EnsoContext`
2024-09-17 20:50:03 +00:00
Jaroslav Tulach
a6fbdb11ce
Avoid using assert in Scala, use assertInJvm to elide it in production (#11027)
Fixes #11022 and in general fixes #5787 by avoiding calls to Scala's `assert` function and using regular one written in Java that uses `assert` keyword and is thus sensitive to `-ea` command line option of the JVM. Use `assertInJvm` in newly written Scala code to get typical JVM behavior on `assert`.
2024-09-16 06:32:47 +00:00
Jaroslav Tulach
8b5c6338f7
Log details when to_display_text invocation fails (#11025)
Closes #10770 by dumping out more information when `to_display_text` invocations fails.
2024-09-11 03:18:06 +00:00
Dmitry Bushev
ab0a5e0c36
Improve the speed of preorder operation on IR (#11019)
close #10537

Changelog:
- add: implement `IR.preorder` method with callback
- update: update `IR.preorder` method usages

# Important Notes
Shows ~10% speed improvement during the compilation
2024-09-10 14:47:50 +00:00
Pavel Marek
19ff2a2bb7
Prepare for JPMS - rename packages (#10974)
* Rename packages in logging-utils-akka

* Migrate buildInfo to Java

* Rename packages in logging

* Rename package in scala-yaml

* No usage of CompilerDirectives inside pkg

* log errors of initialization of directory watcher

* HashCodeNode does not use com.google.common.base.Objects

* Rename rest of the packages

* fmt

* Fix dependencies on version-output

* Add necessary dependencies to testkit

* Rename instruments in runtime-fat-jar module-info

* Fix compilation errors because of BuildVersion

* Fix logger renames

* Use java.util.List directly

* Fixes after merge

* Improve error message in NativeLauncherSpec

* Fix logger renames

* Fix json version formatting

* Revert "No usage of CompilerDirectives inside pkg"

This reverts commit cc7e078416.

* fmt
2024-09-06 10:27:59 +02:00
Jaroslav Tulach
2fc553065f
Get ready for python and js being optional when running test/Base_Tests (#10975)
Let's modify the `Base_Tests` to be able to succeed without JavaScript being installed - **done** in 3298b07dca
2024-09-05 13:00:44 +00:00
Jaroslav Tulach
d37b8f3786
Provide names of local variables via FramePointerAnalysis (#10906) 2024-09-05 10:02:35 +02:00
Jaroslav Tulach
339c275338
Benchmark and speed processing of polyglot java imports up (#10899) 2024-08-29 17:20:53 +02:00
Jaroslav Tulach
1500849c32
When there are no pendingItems for a KEEP_ALIVE period, stop RequestQueue observer thread (#10890) 2024-08-27 10:10:07 +02:00
Jaroslav Tulach
b6f0675563
IO.print without new line (#10858) 2024-08-24 07:00:16 +02:00
Dmitry Bushev
09722b36dc
Provide missing arguments when stepping into a function (#10879)
close #10792

Changelog:
- update: replace missing arguments with `Nothing` when schedule a function execution in interactive mode
2024-08-23 19:13:58 +00:00
Dmitry Bushev
3bfe963e32
Lazy Diagnostic storage allocation (#10852)
close #10727



Changelog:
- add: implement lazy allocation of `DiagnosticStorage` objects
- update: compiler phases to make sure they don't allocate redundant `DiagnosticStorage` objects
- update: cleanup `DiagnosticStorage` class

# Important Notes
As a result, all 10MB of redundant `DiagnosticStorage` allocations are gone

#### Before
![2024-08-21-170148_2092x171_scrot](https://github.com/user-attachments/assets/c1fd34d5-019d-472f-b523-a5c31b87f454)

#### After
![2024-08-21-170058_1693x131_scrot](https://github.com/user-attachments/assets/10d71d81-42b7-4b3c-a49f-ca6267bc6ccf)
2024-08-23 17:48:25 +00:00
Jaroslav Tulach
e5f865f1df
Print out warnings associated with local variables (#10842)
Fixes #9749 by:
- [x] Adding `fn` option to `enso-debug-server` instrument - eb3b76e
- [x] Print warnings (if any) to stderr - 4fda04b
- [x] Improving output of `:list` to print out warnings - dbe3c45480
- [x] Print errors to stderr - 1312546
- [x] Exiting on `DataflowError` - 2cc7ef5 and e6fbf73
- [x] Using all of that inside of `runner/*Main` - 7df58ef

The core of the change is in instrumentation that wraps the `main` method and at its end checks for _warnings or errors_ among local variables. When an error is found, it wraps the original return value of `main` with a proxy that delegates to the original value, but also pretends to be _exit exception_ with exit code 173. That one is detected in `Main` launcher to exit the process with exit code 173.

# Important Notes
As a side-effect of this change, one can request an invocation of REPL at the end of any method just by providing a property to the VM:
```bash
$ enso --vm.D=polyglot.enso-debug-server.method-break-point=err_test.main --run err_test.enso --repl
```
stops at the end of `main` method of `err_test.enso` file.
2024-08-21 07:00:54 +00:00
Jaroslav Tulach
384e01903a
Delay loading of AliasAnalysis data (#10837)
Continuation of #10729 and a step towards #10833 to actually speed things up by 10% by delaying loading of `AliasAnalysis` data.
2024-08-19 09:33:05 +00:00
Pavel Marek
53e99809e2
Store FramePointer in IR (#10729)
* Add stub of FramePointerAnalysis pass

* Add stub of FramePointerAnalysisTest

* Add more framepointer tests

* FramePointer has constructor for better debugging

* Update tests - FramePointer metadata is also in Info.Def

* FramePointerAnalysis traverses the whole IR.

* Fix test - check for metadata

* Reorder methods in FramePointerAnalysis

* Fix argument processing

* Improve some toString methods for debugging

* Fix parent levels in tests

* FramePointerAnalysis does not copy IRs

* FramePointerAnalysis metadata is Persistable

* FramePointerAnalysis attaches metadata to atom constructors

* Synthetic self argument is handled specially

* IRDumperPass is run as the last compiler pass

This ensure that one can see all the metadata on the IR.

* IRDumper can dump alias analysis metadata

* FramePointerMeta has meaningful toString

* FramePointerAnalysis process case expressions

* Fix javadoc links

* FramePointer is attached to GenericAnnotation expression

* IRDumper handles case type patterns

* FramePointer is attached to argument default value expressions

* Add test for default argument value metadata

* Attach frame pointer to default value expressions even if they have no alias graph

* FramePointerAnalysis can run inline on expression

* Fixes after rebase

* Fix annotation processing

* Add tests for no frame pointers on global symbol usages

* Do not use AliasAnalysis in IrToTruffle.

Also refactor NameResolutionAlgorithm to not use AliasMetadata

* Remove unused methods from LocalScope

* Remove unused import

* fmt

* Fix scala.MatchError for case patterns

* Do not use absolute code locations in the test.

Test on Windows fails because of different length of new lines.
2024-08-16 14:28:37 +02:00
Jaroslav Tulach
8e765953a4
Detect outdated launcher (#10779) 2024-08-16 07:37:04 +00:00
GregoryTravis
e836373d9b
Mixed Decimal/Float operations throw error or attach warning (#10725) 2024-08-14 16:45:28 +00:00
Hubert Plociniczak
ff7e31c237
Reducing memory leaks in runtime-integration-tests (#10793)
Inspired by the revert done in https://github.com/enso-org/enso/pull/10778, started looking into apparent memory leaks in `runtime-integration-tests`, written in Java.

Initial state:
![Screenshot from 2024-08-09 14-36-29](https://github.com/user-attachments/assets/39abd48f-503b-49d8-af97-da051352c70d)

After:
![Screenshot from 2024-08-12 16-33-40](https://github.com/user-attachments/assets/2bf4cc2d-7e0e-4d22-8810-c2e7e5c3b065)

# Important Notes
Some remaining issues:
- [ ] [TCK tests](https://github.com/enso-org/enso/tree/develop/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/tck) appear to have some memory leaks but we are essentially enabling them via simple inheritance
- [ ] [RuntimeManagementTest](https://github.com/enso-org/enso/blob/develop/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/RuntimeManagementTest.scala) appears to be broken as it doesn't seem to shutdown properly created threads:
![Screenshot from 2024-08-12 16-29-09](https://github.com/user-attachments/assets/d90aca62-0562-4287-88b7-6d4719e5cf50)

Leaving this for now, as it will probably need to be taken care by initial authors of those tests, if possible. Plus this PR leaves tests in a much better state than before.
2024-08-13 08:01:31 +00:00
Pavel Marek
a79a393ed7
Flatten object hierarchy of AliasAnalysis metadata so it is accessible from Java (#10780)
Flatten hierarchy of alias analysis metadata (`or.genso.compiler.pass.alias.Info`) so that it is easily accessible from Java and rename it.

# Important Notes
- Rename `org.enso.compiler.alias.Graph.Occurence` to `org.enso.compiler.alias.graph.GraphOccurence` and flatten the hierarchy.
- Rename `org.enso.compiler.pass.alias.Info` to `org.enso.compiler.pass.alias.AliasMetadata` and flatten the hierarchy.
2024-08-12 15:03:41 +00:00
Hubert Plociniczak
0f5a3a78b1
Revert "Import all available libraries in --repl mode (#10746)" (#10778)
* Revert "Import all available libraries in --repl mode (#10746)"

This reverts commit 71285e6ff8.

* trigger build
2024-08-09 14:38:05 +02:00
Jaroslav Tulach
8de4b8c9a5
Appending warning to DataflowError is noop (#10765) 2024-08-09 08:39:31 +00:00
Pavel Marek
c2c6712b77
WithWarnings uses EnsoHashMap to speed things up (#10555)
Majority of warnings handling is now done via newly introduced nodes. Moreover, the underlying representation of warnings storage in `WithWarnings` was changed from `Warning[]` to `EnsoHashMap`.

# Important Notes
- Remove `ArrayRope`.
2024-08-07 15:29:57 +00:00
Jaroslav Tulach
71285e6ff8
Import all available libraries in --repl mode (#10746)
Continuation of REPL work (#10709): Import all available libraries when running `--repl`.
2024-08-07 07:36:39 +00:00
Pavel Marek
f0de43a970
Add org.enso.compiler.dumpIr system prop (#10740)
Working on compiler IR is a daunting task. I have therefore added a new system property `enso.compiler.dumpIr` that will help with that. It dumps the encountered IRs to `ir-dumps` directory in the [GraphViz](www.graphviz.org) format. More info in updated docs.

Note that all the functionality to dump IRs to `dot` files was already implemented. This PR just adds the command line option and updates docs.

# Important Notes
- `--dump-graphs` cmd line option is removed as per [Jaroslav's request](https://github.com/enso-org/enso/pull/10740#pullrequestreview-2216676140).
- To dump graphs, use `-Dgraal.Dump=Truffle:2` system property passed via `JAVA_OPTS` env var.

If you run `env JAVA_OPTS='-Denso.compiler.dumpIr=true' enso --run tmp.enso` where `tmp.enso` is, e.g.:
```
from Standard.Base import all
main = 42
```
You will then have something like:
```
$ ls ir-dumps
Standard.Base.Data.Filter_Condition.dot     Standard.Base.Data.Time.dot              Standard.Base.System.Advanced.dot       Standard.Base.Warning.dot
Standard.Base.Data.Locale.dot               Standard.Base.Enso_Cloud.Enso_File.dot   Standard.Base.System.File.Advanced.dot  tmp.dot
Standard.Base.Data.Numeric.dot              Standard.Base.Errors.dot                 Standard.Base.System.File.dot
Standard.Base.Data.Numeric.Internal.dot     Standard.Base.Network.HTTP.Internal.dot  Standard.Base.System.File.Generic.dot
Standard.Base.Data.Text.Regex.Internal.dot  Standard.Base.Runtime.dot                Standard.Base.System.Internal.dot
```
You can then visualize any of these with `dot -Tsvg -O ir-dumps/tmp.dot`.

An example how that could look like is
![image.svg](https://github.com/user-attachments/assets/26ab8415-72cf-46da-bc63-f475e9fa628e)
2024-08-06 12:00:27 +00:00
Radosław Waśko
9b2f611402
Relative paths are relative to current project locally and in Cloud (#10660)
- Close #10622
- Changes `project-manager` and `ensoup` launcher to run the engine/language-server with working directory set to the directory containing currently running project.
- If the working directory is _not_ "the directory containing currently running project", a warning is written to logs. This can happen if the raw `/bin/enso` engine runner is used in a different directory.
- In the Cloud, the `File.new` interprets relative paths as cloud paths relative to the Cloud directory containing the current project. Absolute paths are unaffected.
2024-07-31 09:43:17 +00:00
Hubert Plociniczak
d43ad7ce13
Disable linting passes for IDE and repl (#10705)
There is no need to generate unused variables warnings or other linting for IDE and repl users. By default linting is enabled during compilation and for those use-cases it is now disabled via runtime options.

Closes #9883
2024-07-31 08:49:45 +00:00
Jaroslav Tulach
07bc728b6d
Avoid race condition in GC_Example test (#10665)
Re-enables https://github.com/enso-org/enso/pull/10602/files#r1690919173 - uses `IO.println` to allow us to see what the CI actually does.
2024-07-29 09:37:21 +00:00
Jaroslav Tulach
cb72487cc9
ContextFactory reused to initialize language-server context (#10670) 2024-07-29 09:49:14 +02:00
Dmitry Bushev
9e19009158
When reopening a project no dynamic widgets available (#10674)
close #10595

Changelog:
- fix: storing IdMap from the request
- update: apply updated external ids after loading the module from cache
- update: simplify the node invalidation logic

# Important Notes
https://github.com/user-attachments/assets/c93df161-3bc5-4ecf-8696-239a2498dfb8
2024-07-27 08:21:05 +00:00
GregoryTravis
f0e9616d39
Implement Runtime.Context.Dataflow_Stack_Trace for dataflow errors thrown from Enso (#9625) 2024-07-26 19:20:41 +00:00
Pavel Marek
f849634db3
Atom fields are visible in debugger (#10661)
Atom fields are now visible in the debugger (both chrome inspector and VSCode's debug adapter protocol):
![image](https://github.com/user-attachments/assets/c3d19475-c271-46b6-a44e-e9aebf414b8d)
2024-07-26 06:54:39 +00:00
Jaroslav Tulach
c6da3a93ba
Treat WithWarnings via dedicated @Specialization (#10650) 2024-07-24 15:31:27 +02:00
Jaroslav Tulach
b6bbfc5cda
Prevent re-entrant execution of finalizers (#10602)
Fixes #10211 by avoiding re-entrant execution of finalizers.
2024-07-22 20:11:54 +00:00
Jaroslav Tulach
c0f5759e07
Speeding up Ordering_Comparator (#10593) 2024-07-19 04:08:53 +02:00
Pavel Marek
451d7cb452
System.exit does proper context hard exit. (#10363)
The `System.exit 42` component is treated the same way as any other Panic error - it does not interfere with other component evaluation:
![image](https://github.com/user-attachments/assets/516490b5-755f-453e-8dc9-744437dc51bd)

After removing the `System.exit 42` component, the workflow works as expected. I have also tried opening the project with the component and then removing it.
2024-07-18 18:10:36 +00:00
Jaroslav Tulach
c20eab2af9
Detect compilation while benchmarking (#10574)
Enables `engine.TruffleCompilation` in `std-benchmarks`, collects the logs and dumps compilation into to `System.err` when a benchmark is influenced by dynamic compilation.
2024-07-18 15:49:16 +00:00
Radosław Waśko
4e310d723d
Refactor: split IrToTruffle::processModule into smaller sub-methods (#10587)
- This PR only re-arranges code, splitting the **huge** `processModule` function into a few smaller ones.
- I decided to do it, because when I was working with `processModule` on #9812 I was constantly getting lost in this huge method (this **one** method had 570 lines!) - there is too much happening at once there. Now it's been split into smaller methods, each dealing with one thing.
2024-07-18 12:14:11 +00:00
Hubert Plociniczak
39898da664
Reduce the number of log INFO events (#10500)
Reducing the number of log events that we spam regular users. Not the last PR in that area, but already a progress.
Also replaced `fileWalk` with a stream approach hoping that maybe it is a bit more stable on Windows.
2024-07-17 14:29:48 +00:00
Jaroslav Tulach
a33f632a73
Make EnsoOutputStream fast again! (#10559)
Will fix #10550 by properly using `@TruffleBoundary` annotation
2024-07-16 17:30:56 +00:00
Pavel Marek
0f9852aab2
Replace all from ... export all with explicit exports (#10369)
Replace all exports with explicit exports.
2024-07-11 19:34:25 +02:00
Jaroslav Tulach
077b86f98c
Speed up EnsoInputStream again (#10515)
Fix #10503 by creating a benchmark and then speeding it up by making sure usage of `InteropLibrary` reminds in partially evaluated code and isn't hidden behind `@TruffleBoundary`.
2024-07-11 10:08:26 +00:00
Jaroslav Tulach
220b40a1cd
Enforce conversion method return type & introduce Comparable.new (#10468) 2024-07-11 06:58:51 +02:00
Adam Obuchowicz
60c1a0e1f6
Record control tweaks (#10509)
Fixes #10388

[Screencast from 2024-07-10 13-55-46.webm](https://github.com/enso-org/enso/assets/3919101/4ad7c039-84f6-4e42-aad9-5e287ccd88bb)

# Important Notes
Also, removed unnecessary  setExecutionEnvironment call on startup
2024-07-10 20:19:23 +00:00