CharlesO

CharlesO

I believe there is a similar case for including standard Decimal handling in Elixir just as Date and Time have been standardized as a core part of the language.

Your thoughts?

Showing Posts 1 to 8

aeden

aeden

While it wasn’t difficult to pull in the dependency, I agree that I expected it to be part of the standard lib.

ericmj

ericmj

Elixir Core Team

It’s currently being discussed in the core team if we should add the Decimal library to the elixir standard library. It may or may not happen.

The main reason the calendar types were added to core elixir was to have a common set of data structure all the libraries could use and work on. For decimal types we don’t have this need since afaik there is only one decimal library in the ecosystem.

If you want Decimal added to the standard library you need to argue what the benefits would be.

CharlesO

CharlesO OP

But you have just pointed it out Eric …

There is only one Decimal Library

— If you use Ecto, you automatically pick up this dependency.

Also, HEX places Decimal in the Top 6 libraries …

Having decimal in the language just seems natural.

Unless you know of any Erlang plans to support it as a generic type, I think it’s a good fit for the type of stuff Elixir should offer by default.

ericmj

ericmj

Elixir Core Team

That’s not really an argument, except that it’s popular. The webserver cowboy and dependencies are even more popular, should they also be included in core elixir?

Every extra module in core elixir puts extra burden on the elixir core team. That means less new features and less bug fixes for the existing code in the standard library. The more code the community can take care of the better and with the dependency handling in mix and package management in hex it’s not that much extra work to use a dependency.

tallakt

tallakt

We need to have a long timeframe in mind here. Though I agree that a Decimal built-in would be useful, it does not add much value to add it right now. As there is only one Decimal implementation in use, we should continue using that. At the point where there suddenly for some reason exists alternative Decimal implementations, that would be a much better time to discuss adding it to stdlib, as the problems/design challenges involved would be much better known.

So my vote goes to postponing this at least a few years in time…

hubertlepicki

hubertlepicki

I guess it would make only sense to have it part of the core if it was a simple type, that could use +/-/* operators. If we kept the need to use Decimal.add and friends , this can very well be a separate lib.

Qqwy

Qqwy

TypeCheck Core Team

I agree with this sentiment.

Unfortunately, as +, -, etc are not expected to be overridden because they would stop working in guard clauses (There’s some things we just cannot do in guard clauses right now), I don’t think this will happen anytime soon.

bbense

bbense

FWIW, I have been experimenting with an alternative approach to the Decimal Library.

IMHO, the underlying data structure is not a “solved” problem. Until there is consensus on the underlying data structure, I think putting it in Core is not reasonable.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
caslu
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
marciol
It would be helpful to have a list of companies worldwide that hire engineers without prior experience in Elixir. Often, it can be quite ...
New
durvia
Anyone running long-lived stateful processes on BEAM? We’re building an AI agent runtime and would love to compare notes. We’re a small ...
New

Other Trending Topics Top

marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews