Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odin lang #157

Open
SuperUserNameMan opened this issue Aug 11, 2023 · 0 comments
Open

Odin lang #157

SuperUserNameMan opened this issue Aug 11, 2023 · 0 comments

Comments

@SuperUserNameMan
Copy link

https://odin-lang.org/

fib.odin :

package main

import "core:fmt"

fib :: proc( n : u64 ) -> u64 {
	if n <= 1 {
		return n
	}

	return fib( n - 1 ) + fib( n - 2 )
}

main :: proc() {
	r := fib(47)

	fmt.println( r )
}

Compilation : ./odin build fib.odin -file -o:speed

Test : time ./fib

Result : 8.5 seconds

( For comparison : fib.c compiled using gcc -O3 is 5.3 seconds on my system )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant