Skip to content

A sample application written to demonstrate the InterOp of Elixir and C using GenServers

License

Notifications You must be signed in to change notification settings

sreecodeslayer/ex-math-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exmath

This is a sample application written to learn the implementation of Interoperability of Elixir with C language.

The project's aim is to delegate the work of simple Mathematical function like trigonometry and finding square root, to math.h functions of the C Language.

Elixir supervises the bridge using GenServer(enhancement: a Supervisor over the GenServer later) that connects to the compiled binary of the C program using Ports.

Usage

Currently, this can be tested using the Elixir shell : iex

  1. Compile both C and Elixir sources. Just use:
$ iex -S mix
  1. Examples
iex> Exmath.sqrt(100)
10.0
iex> Exmath.cos(0)
1.0

Todo

  1. Debugging: Add better ways to debug.

About

A sample application written to demonstrate the InterOp of Elixir and C using GenServers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published