sweepai-dev / enso

Hybrid visual and textual functional programming.
https://enso.org
Apache License 2.0
0 stars 0 forks source link

Sweep: Rename the `Decimal` type to `Float`? #1

Open kevinlu1248 opened 11 months ago

kevinlu1248 commented 11 months ago

Discussed in https://github.com/orgs/enso-org/discussions/6858

Originally posted by **radeusgd** May 25, 2023 The [discussion](https://github.com/enso-org/enso/pull/6817#discussion_r1205810671) on #6817 showed that our number type names and `Value_Type` are misaligned: > Unfortunately with `Value_Type` with have a bit of inconsistency between it and the Enso types. > > > > > > >
Value Type > Enso Type >
Value_Type.Integer > Integer >
Value_Type.Float > Decimal >
Value_Type.Decimal > (currently not supported) BigDecimal >
> > The names for value type were chosen to be close to the SQL type names. Maybe we should rename Enso `Decimal` into `Float`?? It is indeed a bit confusing to have this inconsistency. Also indeed, `Decimal` often suggests precise decimals, where we have IEEE-754 floating points. > As discussed, we decided that we want to rename the `Decimal` type to `Float`. - [ ] Rename the `Decimal` type in Enso code into `Float`. - [ ] Also in error messages and docs. - [ ] Rename any references to the `Decimal` type name in the Java engine code. - [ ] Ensure that tests are still passing. - [ ] Rename any utilities in the Java engine, like nodes - `ToDecimalNode` should now be `ToFloatNode`, the `decimal` packages should be renamed to `float` etc.
sweep-ai[bot] commented 11 months ago

Here's the PR! https://github.com/sweepai-dev/enso/pull/6.

πŸ’Ž Sweep Pro: I used GPT-4 to create this ticket. You have 1041 GPT-4 tickets left.


Step 1: πŸ” Code Search

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/docs/semantics/numbers.md#L1-L66 https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso#L331-L513 https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso#L592-L697 https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/docs/syntax/naming.md#L1-L88 https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/engine/runtime/src/test/scala/org/enso/compiler/test/semantic/ImportExportTest.scala#L185-L256

Step 2: 🧐 Snippet Analysis

From looking through the relevant snippets, I decided to make the following modifications:

File Path Proposed Changes
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso Rename the Decimal type to Float and update all its usages in this file.
docs/semantics/numbers.md Update the documentation to replace Decimal with Float.
engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/number/Decimal.java Rename this file to Float.java and update the class name inside the file from Decimal to Float.
engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/number/decimal/ToDecimalNode.java Rename this file to ToFloatNode.java and update the class name inside the file from ToDecimalNode to ToFloatNode.
engine/runtime/src/test/scala/org/enso/compiler/test/semantic/ImportExportTest.scala Update the tests to replace Decimal with Float.

Step 3: πŸ“ Planning

I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:

Rename Decimal type to Float sweep/rename-decimal-to-float

Description

This PR renames the Decimal type to Float in the Enso codebase. It also updates error messages, documentation, and references to the Decimal type in the Java engine code. Additionally, utilities in the Java engine, such as nodes and packages, are renamed accordingly. Finally, tests are updated to reflect the renaming of Decimal to Float.

Summary of Changes

  • Renamed the Decimal type to Float in the Enso codebase.
  • Updated error messages and documentation to reflect the renaming of Decimal to `Float.
  • Renamed references to the Decimal type in the Java engine code.
  • Renamed utilities in the Java engine, such as nodes and packages, to reflect the renaming of Decimal to Float.
  • Updated tests to reflect the renaming of Decimal to Float.

Step 4: ⌨️ Coding

I have finished coding the issue. I am now reviewing it for completeness.


Step 5: πŸ” Code Review

Success! πŸš€


I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind! Join Our Discord