- graphics (@bvssvni)
- interpolation (@bvssvni)
- texture (@bvssvni)
- viewport (@bvssvni)
- float (@bvssvni)
- read_color (@bvssvni)
- vecmath (@bvssvni)
- piston_window (@bvssvni)
- glutin_window (@bvssvni)
- input (@bvssvni)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Diary, Sven Nilsen, 15.09.2016: | |
Reading mathematical papers does help. | |
Woke up with an idea that arguments could be represented as tuples. | |
This idea turned into functional currying. | |
Started coding from scratch today (in Rust of course!) and came this far. | |
I think I'm starting to understand how dependently types work! | |
Path semantics is a new field that might make dependently types more powerful and practical. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn sigmoid(x) -> { | |
return 1 / (1 + exp(-x)) | |
} | |
fn layer(inputs, outputs) -> { | |
return [[0; inputs]; outputs] | |
} | |
fn tensor(sizes) -> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use gl; | |
use gl::types::*; | |
use image; | |
use helper; | |
use color::Color; | |
use mat4::Mat4; | |
pub struct Cube { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Version 0.0.1 | |
use gl; | |
use gl::types::*; | |
use std::ffi::CString; | |
pub fn create_program( | |
vertex_shader: &str, | |
fragment_shader: &str | |
) -> Result<GLuint, String> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn set_x(a: 'return, val: 'a) -> { | |
a.x = val | |
return val | |
} | |
fn main() { | |
y := {x: {0: 0}} | |
set_x(y, {0: 2}) // ERROR: Requires reference to variable | |
println(y) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root] | |
name = "piston-examples" | |
version = "0.0.0" | |
dependencies = [ | |
"camera_controllers 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
"find_folder 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
"gfx 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", | |
"gfx_device_gl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |
"image 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", | |
"piston-ai_behavior 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[(Range { offset: 20, length: 0, phantom: PhantomData }, StartNode("materials")), (Range { offset: 45, length: 0, phantom: PhantomData }, StartNode("material")), (Range { offset: 45, length: 7, phantom: PhantomData }, String("name", "metal")), (Range { offset: 86, length: 3, phantom: PhantomData }, F64("reflectivity", 1)), (Range { offset: 45, length: 59, phantom: PhantomData }, EndNode("material")), (Range { offset: 118, length: 0, phantom: PhantomData }, StartNode("material")), (Range { offset: 118, length: 9, phantom: PhantomData }, String("name", "plastic")), (Range { offset: 161, length: 3, phantom: PhantomData }, F64("reflectivity", 0.5)), (Range { offset: 118, length: 61, phantom: PhantomData }, EndNode("material")), (Range { offset: 20, length: 170, phantom: PhantomData }, EndNode("materials")), (Range { offset: 200, length: 0, phantom: PhantomData }, StartNode("entities")), (Range { offset: 224, length: 0, phantom: PhantomData }, StartNode("entity")), (Range { offset: 248, length: 6, phantom: Phantom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
whitespace { optional }: | |
whitespace? | |
token("whitespace") | |
select( | |
token("?") as optional | |
token("!") as !optional | |
) | |
whitespace? | |
parameter { name, args, value }: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 CGLSetOption(pname = kCGLGOUseErrorHandler, param = 0) = kCGLNoError | |
1 CGLChoosePixelFormat(attribs = {kCGLPFAOpenGLProfile, kCGLOGLPVersion_3_2_Core, kCGLPFAColorSize, 32, kCGLPFADepthSize, 16, kCGLPFADoubleBuffer, kCGLPFADisplayMask, 4, 0}, pix = &0x7ff0c9d00f10, npix = &2) = kCGLNoError | |
2 CGLSetOption(pname = kCGLGOUseErrorHandler, param = 0) = kCGLNoError | |
3 CGLCreateContext(pix = 0x7ff0c9d00f10, share = NULL, ctx = &0x7ff0ca803600) = kCGLNoError | |
4 CGLSetParameter(ctx = 0x7ff0ca803600, pname = 1236, params = &-909113104) = kCGLNoError | |
5 CGLReleasePixelFormat(pix = 0x7ff0c9d00f10) | |
6 CGLSetSurface(ctx = 0x7ff0ca803600, cid = 0xd97b, wid = 68112, sid = 1642141264) = kCGLNoError | |
8 CGLUpdateContext(ctx = 0x7ff0ca803600) = kCGLNoError | |
9 CGLSetCurrentContext(ctx = 0x7ff0ca803600) = kCGLNoError | |
10 glViewport(x = 0, y = 0, width = 600, height = 600) |