1. 17

This is the weekly thread to discuss what you’ve done recently and are working on this week.

Please be descriptive and don’t hesitate to ask for help, advice or other guidance.

  1.  

  2. 12

    Howdy!

    This last week has been pretty exciting for me. I ended up spending 42 hours in the hospital after getting an acute stomach infection and doing some champion-class vomiting and then a good fever and shaking chills. I’ve no idea what I did to deserve that.

    That put a bit of a cramp on things as it is hard to type with an IV in your hand, so I took the opportunity to rest, relax and do a lot of reading.

    I did some coding here and there with Dylan, but nothing terribly exciting. It was mainly clean-up work and things that don’t require too much brainpower.

    I did make a think-o while writing some code though and found a situation where the compiler didn’t report any errors in a construct that we use for sealing part of a multi-method hierarchy from being extended further (and for use extensively by the optimizer). I added support to the compiler now for validating that construct and presenting warnings rather than silently failing.

    Today, Peter Housel landed 25 commits from his branch for LLVM support. There are still more than 58 commits remaining on his branch, so he’s got some work ahead of him.

    I also took advantage of being bed-ridden and unable to type much by reading large parts of our macro-expander. The honest truth is that no one has really understood our macro-expander in over 15 years. Thankfully, I’m in touch with one of the original authors, although I suspect he doesn’t remember all that much. This was just reading and familiarization for now as I don’t have the time it would take to dive in and fix some of the issues that we have with it (involving error reporting).

    I wrote a blog post today about why Dylan is not actually gradually typed based on some research that I did into the compiler and how it handles some situations. I’ll probably post that on Lobste.rs in the coming day.

    Until next week!

    1. 8

      Back on the Rockets bandwagon.

      Rockets is a game I’ve been thinking about / prototyping for about a year. I’m trying to make a serious push towards it now though so that I can get a playable version going. It’s a game where you “program” a rocket ship to fly around (2d) space and complete levels. Previous prototypes were in clojurescript and racket and used a logic based language for describing the rules the ship needs to follow. I’m currently working out a node graph based ui for describing motion of the rockets instead. I’ve migrated to using strait c and opengl for gamedev stuff. I’ve watched a lot of handmade hero and finding that it turns out to be a pretty great environment for game dev. I come from the functional programming world but was able to set up many things that I enjoy using, for example I can recompile my game and update the code while it’s running which gives a repl like experience to game dev that I really enjoy. This week I’m ramping up some opengl knowledge. The graphics are pretty simple so there shouldn’t be a ton to do here but one of the most immediate needs I have is to display text. That’s what I’ll focus on in the beginning of the week and then hopefully get some node graph interactions working so I can get it playable.

      1. 6

        Last week I managed to:

        • Convert an Angular app from JS to TypeScript 1.4
        • Redesign the web site for A Drip of JavaScript
        • Make progress on Chapter 3 of the Jasmine book. I estimate that I’m 2/3 of the way through the chapter.
        • Resume a bit of writing on my steampunk fantasy novel.

        This week I plan to:

        • Be out of commission for about a day due to dental work.
        • Write a new article for A Drip of JavaScript, subject TBD.
        • Finish Chapter 3 of the Jasmine book.
        • Catch up on Drip-related emails.
        • Continue work on the Steampunk novel.
        1. 6

          This Saturday I finally switched the API keys from test to production on my side project. That was an incredibly nerve-wracking experience. Pestering some IRC friends to try it out resulted in a 0% conversion rate (which is still better than a 0% rate because you never launched). So this week I’ll be hacking on:

          • Making it more clear what the product does
          • Allowing the user to demo the product before they try
          • Changing the pricing schema so it’s more clear

          If anyone knows good writing on proper user onboarding, I’d love to hear it. Hopefully next week it’ll be ready to post here.

          1. 3

            What’s the project? Mind sharing here?

            1. 2

              The general idea is Birthday Cards as a Service - the software takes care of all the hard parts of handling birthday cards (getting the card, remembering to send it at the right time, etc) while still letting you pick the colors/message/etc.

          2. 6

            This weekend, I spent some time porting my TypeScript documentation tool to PureScript, and putting the resulting library on NPM. I have since discovered the excellent TypeDoc tool, which I have started using to document my TypeScript code. I think there is still some value in typescript-docs, especially since it seems a bit faster for large inputs, not having to rely on the TypeScript compiler to parse the source code, so I will continue to work on it. If nothing else, it might be interesting to reuse the parser to try to take advantage of TypeScript’s .d.ts files in the PureScript FFI.

            Also, the PureScript bug backlog has been steadily growing, so I will spend some time squashing some bugs there.

            At work, I hope to wrap up our third Haskell microservice, and start deploying that into production.

            1. 3

              What are you using to build out the Haskell microservices?

              1. 2

                The current one is built using Groundhog for database access and Servant for web services, both of which have been fantastic for my use case. I also wrote a little bit about using Haskell at work here previously.

            2. 5

              This past weekend I started reading An Introduction to Computer Networks by Peter L Dordal. This first chapter is an overview of the various layers and how they interact with each other. I’m in the process of reading the second chapter, which dives into Ethernet.

              I am just beginning to explore all things networking, so I’m not currently working on a project. I did come across Mininet, so I may dive into that as I start looking for things to hack on.

              1. 5

                I tried to update a customer to some new stuff and get them off old servers. Everything has to connect over SSL and the old servers are still not updated to mitigate all the known attacks so far. This particular customer’s clients are PHP and use OpenSSL for the connection. Unfortunately its an old PHP (5.4.x) and an old OpenSSL (0.9.8b).

                The first thing I considered was asking the customer to update PHP and OpenSSL. I tried it myself on my MBP and couldnt figure it out so bail on that. I asked for SSH access to the customer’s machine and did some tests with openssl s_client -msg -debug to see how and why it wasn’t working. The old versions of OpenSSL always start with SSLv2 ClientHello UNLESS you specify -no_ssl2 or -tls. (Looking at OpenSSL changelog seems this was changed in 0.9.8n). Looking at the source for PHP, I was able to figure out that the only way to set that flag was to open a stream socket wrapper with tls:// as the scheme, BUT then you have to write the HTTP protocol yourself. I found a library to write HTTP protocol, Snoopy, and modified it to use the tls:// scheme and some other stuff I needed. The client’s test site is working correctly against the new servers.

                This week I’m going to shore up stuff to use Snoopy in the case of really old OpenSSL situations.

                1. 5

                  I’ve been working on Haskell bindings for Thrust. It allows you to create easily deployable desktop apps using embedded Chromium for your user interface (like node-webkit).

                  It feels like I’m being too eager choosing this for my first Haskell project but thanks to the amazing GHC compiler I was able to keep fixing the type errors and get something working even with my elementary understanding of the language.

                  I think the API turned out to be not that bad. Here is an example showing how to build a menu: https://gist.github.com/osener/17f16ebd78064d2931b9 (you can compare it with the go version), and another one using Haste for type-safe client server communication https://gist.github.com/osener/5282f97b1c7a77e0ad31

                  1. 4

                    I managed to implement a fast medcouple last week:

                    https://groups.google.com/d/msg/pystatsmodels/6QWW4tynDW8/YyKdKJkE7bEJ

                    Part of this exercise was translating Python into C++ as literally as possible. This is now very possible! I feel like I could write most of my Python thoughts almost verbatim in C++, and got a huge speed boost as a result. My C++ implementation is just as fast the reference C implementation, and it looks very “Pythonic”.

                    This week I’m going to write some expository material about the medcouple and the Python-to-C++ translation effort. Then I’ll figure out a way to woo the GPL phobics who won’t accept my code.

                    1. 4

                      $work: Rebuilding stuff where it’s needed, doing some housecleaning on our gitlab server, honestly it’s a lot of scutwork, but I don’t mind.

                      !$work: Missus is finally getting her wisdom teeth out. It’s been put off for a while but we’re finally getting it done. So my week is mostly going to be about making sure she’s okay. I get to see her on Valium, which will be fun.

                      I’m also working on some stuff with Sage. Even after looking at some of the other things folks mentioned last week, I’m still pretty happy with Sage. It’s got a pretty good suite of features, and while the documentation is definitely focused on some of the high level stuff it can do (rather than more practical stuff), I’m finding it to be a really nice tool to work with. I’m also really loving how trivial it is to plug it in to otherwise normal math processing and end up with a result that’s useful. What it means practically is I can go about writing otherwise pure python code, then abstract some inputs and be handed back an equation with minimal difficulty.

                      I will say, I’m feeling a little squeeze when it comes to Python’s metaprogramming abilities. Compared to Ruby (which is what I spend most of my day writing), it’s really quite limited. I’m also not a big fan of the jumping between method-invocation and function-invocation for stuff. Sometimes it’s float(this) and sometimes it’s this.that and it doesn’t have the same, nice consistency that Ruby does. Everything in ruby is .something. No parens, no function-invocation, just method-style invocation. I really miss that about ruby.

                      I also don’t really care for the :’s littered everywhere, I feel like that’s a bit of syntax that is generating more heat than light.

                      Ultimately for someone who hadn’t really planned to learn python over the last two weeks, I’m finding it not entirely terrible. I vaguely wish Sage was on something I knew better, but at least it’s not making me write more Mathematica script.

                      1. 4

                        The colons in Python were put in because there was evidence that it helped beginners understand that a new block now follows. They were first tested on the experimental ABC language before being put into Python:

                        https://docs.python.org/3/faq/design.html#why-are-colons-required-for-the-if-while-def-class-statements

                        I’m happy to hear that you’re mostly enjoying Sage so far. Some day, if my dream to make GNU Octave widely successful happens, my next goal will be to do all I can to improve Sage.

                        1. 2

                          I suppose I can’t argue with the results of an experiment, I will say that I’ve tripped up a lot in forgetting to write them, but then again – optimizing for readability is okay by me.

                          I really love me some Octave when I need it. Nothing crunches numbers quite like it. I spent a while using it on a client project last year (doing some DSP and analysis with it), the project ultimately didn’t get off the ground (client ran out of money), but he was quite enamored of a free Matlab-alike, pretty sure he’s still using it. For my part, I’m generally not on the number-crunchy side of things (that client being the exception, not the rule); so sage is like a dream come true. Something as powerful as Mathematica or Maple, but without the awful, awful language attached.

                      2. 4

                        I’m getting a little frustrated with the Rust client and the perpetual moving target. My last few weeks work (granted, not that much of it) has been trying to get the code to compile and figure out ownership. I guess my old model of programming was “if it’s immutable, it doesn’t matter where you send/use values” and I write a lot of my code to not mutate values. Unfortunately this is not enough for Rust’s borrow checker and I am wrapping my head around it.

                        I did publish a library called dnstimeout with one function, lookup, that lets you make a DNS request with a timeout attached. https://github.com/kevinburke/dnstimeout/blob/master/src/lib.rs#L10

                        Trying to figure out whether I want to persist with the project for now or wait until Rust is a little more stable. If not I need to figure out a new side project.

                        I’m also working on blocking Verizon’s tracking header everywhere. I had two ideas for this - use my own DNS which doesn’t resolve the most common ad network domains (scorecardresearch, doubleclick, mixpanel etc), and/or use a VPN. Unfortunately iOS makes it difficult to configure DNS when you’re on your carrier’s network, and it also makes auto-connecting to a VPN difficult - I have to go into settings and connect it every time. Fortunately Verizon’s network is good enough that VPN connectivity is not a problem.

                        1. 1

                          Would be cool to see a code example of your “immutable data + unhappy borrow checker” situation with Rust.

                          1. 2

                            Sure, in the signature of the one dnstimeout function, I wouldn’t worry too much about borrowing the host string since I’m not doing anything destructive with it, but Rust complains.

                        2. 4

                          OMG My Idris/Erlang compiler should be done, as well as some nifty OTP-ish stuff. If it’s done this week, I can start to write about it for my dissertation, and feel slightly less pressure on me to get everything done.

                          1. 3

                            On friday I released Fire★ 0.5 with Lua 5.3.0 support. I have Mac, Linux, and Windows binaries. Check it out!

                            I also made a lot of progress on my magical todo list program called “muda”. This week I am adding a user account page where you can export your todo list if you like. Or change password, etc.

                            It is strange to work on web apps, since this is really my first time.

                            1. 3

                              Yay

                              1. 3

                                I am learning FreeBSD. I have been spending the last few days setting up my FreeBSD VM that I will use as primary development system. I had to modify some programs I have written to compile under it. I’ll continue on that path and see how I like it (so far I find it better than generic linux distro but not as good as NixOS).

                                1. 2

                                  I’m working on a quick tool for calling Thrift services + inspecting responses on the command line, much like you would cURL a JSON api: https://github.com/herval/thrurl

                                  1. 2

                                    At work, i’m improving the integration between our internal testing tool and the logging/recording database.

                                    Outside of work, I got my Lisp ray tracer working with spheres, lights, and very basic shading. The code is still ugly, and it’s not optimized at all, but it works, which is the first step :-) Code is here. Sample image is here.

                                    Also started reading “Mathematics for Computer Science”, for no particular reason.

                                    1. 2

                                      Still working on the DSL for probabilities. But this time, I’ve added stuff for joint probabilities in both the a posteriori and a piori variables. I discovered that I needed it to calculate the decision trees: IG(size | weight, texture = smooth, opacity = transparent). Once I get that part finished, I can finish the decision tree learning algorithm, and start testing it on real data. https://github.com/iamwilhelm/decision_tree

                                      I also wrote three more chapters in the eBook, “Designing with OpenSCAD”. It’s a book on how to write OpenSCAD to make 3D printable models. OpenSCAD is a declarative programming language you write to make 3D models. The three new chapters covered how to use modules, how to refactor, and how to make reusable code. https://leanpub.com/designing_with_openscad/