Regarding point 2. We can't generate different bytecode for decimals and
integers because at compile we don't what the type of values are.

Regarding point 3. The VM is restrictive in what functions and operations
are allowed in guards so we cannot use decimals there.

On Thu, Jun 30, 2016 at 11:38 PM, <elxir....@gmail.com> wrote:

> First of all thanks everyone the constructiveness and the great ideas.
> I'm new to Elixir, so please forgive me if I've some bad assumptions.
>
>    1. Supporting number format like 1.32f or 12.45d, etc would be great
>    2. Regarding using the regular arithmetic operators like +, -, * and /
>    for decimal type, I fail to see why it would be slower for integers for
>    example. At the end I'd assume only the generated byte code matters. So why
>    not generated the usual byte code when integers or floats are used and
>    generate some advanced logic when the operands are of decimal type?
>    3. Guards, following Peter's suggestion and using some logic for byte
>    code generation (as mentioned in point #2) again I think it would be
>    possible to handle decimal types transparently.
>    4. I think simplifying a couple of things, like handling the decimal
>    types (which is a must for financial apps)/removing boiler plates, would
>    have a positive effect on language adoption as well
>       - I know it's off-topic, but it might worth mention that such
>       simplifications could do wonders, Elixir is great language but why not 
> make
>       even better out of the box, like:
>          - instead of specifying a method like this:
>          @spec add(number, number) :: number
>          def add(x, y), do: ...
>
>          it would be far easier to write it a single line like this:
>          defs add(number x, number y) :: number, do: ...
>          - or embrace the familiar lambda syntax for defining in-line
>          functions, so that parameters could be referenced by their name, 
> instead of
>          their position
>          - etc
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/bb8734c9-5d6f-40ad-8bbb-0267786f971e%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/bb8734c9-5d6f-40ad-8bbb-0267786f971e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Eric Meadows-Jönsson

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAM_eaphCQpM7jzoH3%3DNkjb84sFwuVS9_SuS2yQUz-rhE--Hq%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to