Harfang's Perch

  • Posts
  • About
  • RSS
  • Atom
  • English
  • 한국어
  • Understanding Computation - Review

    2017-08-17

    Summary

    If you are a software developer without formal computer science background who want a friendly introduction to computer science, I highly recommend this book.

    This book explores some of core concepts of computer science, specifically syntax and semantics of programming languages and basic abstract machines that can execute programs. The author writes in a concise, easy-to-read, and lighthearted style, providing codes that you would write at your daily job as examples. It’s much easier to read than a typical academic writing that’s full of bizarre mathematical symbols.

    Read more
  • Why I Chose Docker for Sandboxing

    2017-08-11

    Overview

    I wanted to build an Elixir application that can run Elixir code provided by users and return the results. Maintaining security is critical for an application like this, since I could be running some evil codes written by diabolical mastermind residing in the scary trench of Internet. I’ve never done something like this before, so I had to research extensively for a good solution.

    Unfortunately there does not seem to be a perfect solution, as always. After considering tradeoffs, I chose to settle for Docker container with some security options. I think it’s a reasonably secure and reasonably performant option for my use case. This blog post is a journal of what I’ve learned while building the application.

    I am by no means an expert in this matter, so read this as not as a survey of technology but as a personal journal. I do welcome correction and additional resources to better my understanding. And if you want an overview of sandboxing technology landscape, I recommend Sandboxing landscape by Marek (@majek04). It’s a broad, up-to-date, and also well-written article as much as I can tell.

    Read more
  • Preventing Race Condition When Testing Cast Requests in Elixir

    2017-07-09

    This post assumes understanding of how GenServer.cast/2 and GenServer.call/2 work.

    TL;DR

    Call a GenServer.call/2 function after GenServer.cast/2. This prevents your caller process from executing any more code until it receives a reply to the call/2 function from the receiver process. The receiver process handles and sends the reply to call/2 only after it has handled the message from cast/2. This can ensure sequential execution of code. If you need a generic function, :sys.get_state/1 can be used for this purpose.

    Read more
  • My Brief Foray into the Land of Haskell (2)

    2017-05-15

    Nowadays many features of Haskell can be found in other languages, too. But such features often feel like an awkward addition to languages that are designed for different goals in mind. In contrast, functional programming elements are given the highest accommodation in Haskell. I think this is what makes Haskell special - it is purely dedicated to functional programming. So even though Haskell and other languages might be providing theoretically identical features, the experience of using them is so vastly different. I think I could learn the following lessons because of this special atmosphere that Haskell has.

    Read more
  • My Brief Foray into the Land of Haskell (1)

    2017-04-29

    The Scary, Scary Land of Haskell

    I think few other programming languages evoked as much trepidation in me as did Haskell. After all, it is a language known for being arcane and unusual. Still, everyone said that learning Haskell would dramatically broaden my understanding of programming, so I’ve been eyeing for an opportunity to venture into the land of Haskell for a while.

    Read more
  • How to Find Full Function Name in Elixir

    2017-04-24

    Sometimes you want to know the full name of an imported function, including the name of the module it is defined in.

    Capture the function name with & and pass it to IO.inspect/1 to reveal its full name.

    Another way is to rummage through __ENV__.functions/0 which lists all the modules and functions loaded into your compile time environment. Information about __ENV__ can be found here.

    Read more
  • How to Display Plug Errors

    2017-03-30

    This post is aimed at those who are just starting to use Plug, a great web middleware for Elixir language.

    TL;DR

    If you want to access various error messages from Plug that do not show up in Logger, Plug.Debugger will make those failed requests appear. Check out Plug.Debugger.

    Read more
  • What Makes Pattern Matching in Elixir So Nice?

    2017-03-15

    Many people pick pattern matching as one of the nicest features of Elixir. But it’s hard to explain why or how it is nice - it’s something experiential that arises from the combination of pattern matching and other characteristics of Elixir.

    In this post I will present a few examples of pattern matching in Elixir to describe why it is such a great feature. The target audience of this post is people with experience in object-oriented programming (OOP) but without much exposure to functional programming (FP). The post is not about an in-depth comparison between pattern matching in Elixir and pattern matching in other languages.

    Let’s get started.

    Read more
  • My Favorite Ruby Rogues Episodes - Career and Organizational Management

    2017-03-04

    Previous post was about episodes that discuss how to grow as an individual developer. This post is about episodes that discuss career management and organizational management.

    This is the last post. I’ve mostly left out episodes about specific Ruby techniques and tools, and episodes about developer communities or social responsibilities as they are more specialized interest.

    Read more
  • My Favorite Ruby Rogues Episodes - Personal Growth

    2017-02-25

    The previous post was about book club episodes. This post is about episodes that discuss methods and perspectives that can help you grow as an individual developer.

    Read more
1 2 3 4 5 6