<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>my projects on about me</title>
    <link>/projects/</link>
    <description>Recent content in my projects on about me</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 08 Aug 2023 00:00:00 +0000</lastBuildDate>
    <atom:link href="/projects/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>rust ray tracer</title>
      <link>/projects/rust-ray-tracer/</link>
      <pubDate>Tue, 08 Aug 2023 00:00:00 +0000</pubDate>
      <guid>/projects/rust-ray-tracer/</guid>
      <description>&lt;h3 id=&#34;what&#34;&gt;what?&lt;/h3&gt;&#xA;&lt;p&gt;good old ray tracer again&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/ray-tracer/rust-spheres.png&#34; alt=&#34;final scene&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;why&#34;&gt;why?&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;earlier last year i followed &lt;a href=&#34;https://raytracing.github.io/books/RayTracingInOneWeekend.html&#34;&gt;&lt;em&gt;Ray Tracing in One Weekend&lt;/em&gt;&lt;/a&gt; and implemented it in go to get a hang of the language. it was all nice and fun but rendering the final scene took arround 20 minutes in my M1 Macbook Air, so i was left feeling a little disatisfied.&lt;/li&gt;&#xA;&lt;li&gt;i have been solving many &lt;a href=&#34;https://open.kattis.com&#34;&gt;&lt;em&gt;kattis&lt;/em&gt;&lt;/a&gt; problems in rust (particularly those that are just too slow to run in python), and i wanted to try rust on a slightly more complicated &amp;lsquo;project&amp;rsquo;&lt;/li&gt;&#xA;&lt;li&gt;i really wanted to see how rust concurrency feels.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;conclusions&#34;&gt;conclusions&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;computer graphics are very hard to debug. really. really. hard. i spent days fixing a very subtle bug.&lt;/li&gt;&#xA;&lt;li&gt;i started defining a trait &amp;lsquo;hitable&amp;rsquo; and was planning to just extend types as i needed them, but as i started testing it, it really wasn&amp;rsquo;t any faster than the go version. so i decided to replace as many allocations as possible and not use any dynamic dispatch and i think i&amp;rsquo;m happy with the results. i think rust enums make up for the lack of abstractness in this scenario&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://docs.rs/rayon/latest/rayon/&#34;&gt;&lt;em&gt;rayon&lt;/em&gt;&lt;/a&gt; is cool and very very simple&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;todo&#34;&gt;todo&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;lights!&lt;/li&gt;&#xA;&lt;li&gt;more materials!&lt;/li&gt;&#xA;&lt;li&gt;more geometries!&lt;/li&gt;&#xA;&lt;li&gt;textures!&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://raytracing.github.io/books/RayTracingTheNextWeek.html&#34;&gt;&lt;em&gt;Ray Tracing: The Next Week&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://raytracing.github.io/books/RayTracingTheRestOfYourLife.html&#34;&gt;&lt;em&gt;Ray Tracing: The Rest of Your Life&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;links&#34;&gt;links&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://github.com/Ikerlb/rust-ray-tracer&#34;&gt;code&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>mandelrust</title>
      <link>/projects/mandelrust/</link>
      <pubDate>Tue, 10 May 2022 00:00:00 +0000</pubDate>
      <guid>/projects/mandelrust/</guid>
      <description>&lt;h3 id=&#34;what&#34;&gt;what?&lt;/h3&gt;&#xA;&lt;p&gt;i basically wanted to have a random zoom on an interesting mandelbrot point:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;-0.761574 + -0.0847596i &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;why&#34;&gt;why?&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;i wanted to try out rust in an aws lambda function&lt;/li&gt;&#xA;&lt;li&gt;i wanted to build that lambda function with cdk (i&amp;rsquo;m kinda procrastinating from learning/using terraform)&lt;/li&gt;&#xA;&lt;li&gt;i was kinda hyped to use rust after reading about it&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;conclusions&#34;&gt;conclusions&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;i&amp;rsquo;m starting to dig aws hehe.&lt;/li&gt;&#xA;&lt;li&gt;i &lt;strong&gt;really&lt;/strong&gt; like rust and will keep using it as much as i can&lt;/li&gt;&#xA;&lt;li&gt;i will never ever find mandelbrot set uninteresting&lt;/li&gt;&#xA;&lt;li&gt;rust lambda startup time is unlike anything i&amp;rsquo;ve ever seen. it draws (for me, at least) the line between server and serverless kinda blurry&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;todo&#34;&gt;todo&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;well this seems obvious but i don&amp;rsquo;t want to use a single point and a random zoom but rather a set of interesting points and a random zoom! all this seems kinda time consuming so i guess i&amp;rsquo;ll leave it like this for a while&lt;/li&gt;&#xA;&lt;li&gt;i also want to optimize mb allocated for each lambda execution. 128mb takes arround 13 seconds to finish, while 1gb takes arround 3.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;update-10-5-2022&#34;&gt;update 10-5-2022&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;i&amp;rsquo;ve been consuming a lot of terraform content. but as you may know by now, in the realm of programming you learn mostly by getting your hands dirty, so i tried importing (this is the single feature i liked the most) most of the resources i used on cdk and got them up &amp;amp; running in terraform. it is beautiful.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;links&#34;&gt;links&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://lissarrague.xyz/mandelrust/&#34;&gt;demo&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://github.com/Ikerlb/mandelrust-lambda&#34;&gt;cdk code&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://github.com/Ikerlb/tf-mandelrust&#34;&gt;terraform code&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>go ray tracer</title>
      <link>/projects/go-ray-tracer/</link>
      <pubDate>Mon, 21 Feb 2022 00:00:00 +0000</pubDate>
      <guid>/projects/go-ray-tracer/</guid>
      <description>&lt;h3 id=&#34;what&#34;&gt;what?&lt;/h3&gt;&#xA;&lt;p&gt;a ray tracer of course! if you are not familiar with the term, it is basically a rendering technique that is very intuitive, and fairly easy to implement naively (and yields very decent results), but tends to be computationally expensive.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;/ray-tracer/go-spheres.png&#34; alt=&#34;final scene&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;why&#34;&gt;why?&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;back in my Modeling and Programming course, we were asked to implement a ray tracer in order to get one extra credit. back then, though, even fairly easy problems seemed very scary and alien to me (plus, i had a pretty good score already). i came across &lt;a href=&#34;https://raytracing.github.io/books/RayTracingInOneWeekend.html&#34;&gt;&lt;em&gt;Ray Tracing in One Weekend&lt;/em&gt;&lt;/a&gt; recently and i thought i owed it to my old self to get it done as soon as possible.&lt;/li&gt;&#xA;&lt;li&gt;this should come as not surprise if you&amp;rsquo;ve read &lt;strong&gt;anything&lt;/strong&gt; i post in this website, but i wanted to see how go felt when programming something bigger than a &lt;a href=&#34;https://leetcode.com&#34;&gt;leetcode&lt;/a&gt; problem.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;conclusions&#34;&gt;conclusions&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;this was really really fun. if you haven&amp;rsquo;t already give it a go (pun intended)! it is supremely well written and if you&amp;rsquo;re anything like me, you&amp;rsquo;ll have a blast.&lt;/li&gt;&#xA;&lt;li&gt;i implemented some very simple concurrency and i&amp;rsquo;m in awe of how easy goroutines and channels make for concurrent design. (also, i saw &lt;a href=&#34;https://www.youtube.com/watch?v=oV9rvDllKEg&#34;&gt;this&lt;/a&gt; long ago and it was in my mind throughout this project)&lt;/li&gt;&#xA;&lt;li&gt;i think i&amp;rsquo;m starting to like go (i mean, it is as simple as it gets). plus &lt;a href=&#34;https://go.dev/doc/tutorial/generics&#34;&gt;generics!&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;todo&#34;&gt;todo&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;while making it concurrent and giving it more cores to run in parallel made it significantly faster, i&amp;rsquo;m still not satisfied by the results. rendering the final scene of the project takes about 15 minutes in my M1 Macbook Air with the full 8 cores. i think i can squeeze some performance by making garbage collector do less work. we&amp;rsquo;ll see how it goes.&lt;/li&gt;&#xA;&lt;li&gt;lights!&lt;/li&gt;&#xA;&lt;li&gt;more materials!&lt;/li&gt;&#xA;&lt;li&gt;more geometries!&lt;/li&gt;&#xA;&lt;li&gt;textures!&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://raytracing.github.io/books/RayTracingTheNextWeek.html&#34;&gt;&lt;em&gt;Ray Tracing: The Next Week&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://raytracing.github.io/books/RayTracingTheRestOfYourLife.html&#34;&gt;&lt;em&gt;Ray Tracing: The Rest of Your Life&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;links&#34;&gt;links&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://github.com/Ikerlb/ray-tracer&#34;&gt;code&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
  </channel>
</rss>
