Skip to content
This repository has been archived by the owner on May 11, 2019. It is now read-only.

RFC: StdLib: std.math (Math library) #16

Open
Qix- opened this issue Jun 2, 2016 · 3 comments
Open

RFC: StdLib: std.math (Math library) #16

Qix- opened this issue Jun 2, 2016 · 3 comments

Comments

@Qix-
Copy link
Owner

Qix- commented Jun 2, 2016

The std.math library is a standard library that provides functions and operators.

TODO

I want to provide standard implementations of FFT, operators that use mathematical symbols, etc. For instance,

use std.math.ops.*

a i32 = 4
b f32 = √a

Any ideas on this would be nice. Fleshing out the standard library isn't something I want to mess with yet as I have a strong opinion about separating the language from the libraries.

@corbin-r
Copy link

corbin-r commented Jun 3, 2016

I think you should have FFT implementations joined with #18 this could be quite powerful.. Being able to use math functions just by using a symbol.

However there is something to be wary about, the more symbols that are jammed into the language, the more the compiler has to work to link those symbols to the proper function (taking up compile time), there most likely is a way to go about this as said in #18 with "writing arua in arua" so there would be a 1:1 ratio of the language being compiled.
So I would have dedicated symbols for the more simple math functions (beside the normal +-/*). But reserved more complicated math functions to actual function names.

@Qix-
Copy link
Owner Author

Qix- commented Jun 3, 2016

@PolyGN yep exactly. As well, the additional symbols have to be imported to work; they're not globals.

FFT would be super powerful, though I'm worried about specific implementations being less ideal than others, etc. MatLab users don't seem to have a problem with any of that though. Just a thought on FFT specifically.

@corbin-r
Copy link

corbin-r commented Jun 4, 2016

@Qix- True. MatLab does have an efficient way of having custom symbols for complex math operations. Well... If you write the language to be like Swift, in the sense that it supports unicode (which wouldn't be hard) you could easily parse the unicode characters and have Arua understand that those are reserved math symbols/functions, you're golden.

EDIT
Just realized you referenced unicode support here: #11

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
RFCs
Proposed
Development

No branches or pull requests

2 participants