Stephen Cagle

Menu

  • Home
  • Archives
  • About Me
  • RSS
April 18, 2016

Clojure / West 2016

A recording of all that I saw and hear at Clojure West 2016 in Seattle Washington.

Nathan Marz Specter

Github

  1. Navigation is independent abstraction
  2. Navigation dissasociated from the desired transformation
  3. Provides type defined defaults for navigation to nil
  4. Assuming you can write a generic enough function

This library lets you navigate and modify deeply nested and deeply repetitive data structures. Fundamently, it raises the barrier before you need to start putting things in a database by making it possible to just reason about data when the data is very deep or very broad. It makes the actionable code look like a DSL in its conciseness; without actually being a DSL. Having said that, it is bringing in a rather large "mini DSL" in order to allow for the data manipulation.

Donevan Dolby

This was a walkthrough of a 16,000 line of code Clojure App. Lessons were learned, libraries were used, and discarded. Code is being used on the Boeing 737 MAX; which is evidently a new plane with a focus on efficiency.

Claire Alvis

https://github.com/SparkFund/spec-tacular

An attempt at putting some sort of stronger typing on entities in Datomic. Graded various aspects of her attempt. Did not entirely follow due to lack of familiarity with Typed systems in particular.

  1. Adds types in to Datomic by having a spectacular shema -> becomes datomic schema
  2. Verification of code
  3. Documentation is specified by the spec

Michał Marczyk

This was just a deep dive into exactly what a record is and when it is appropriate to use one. A record is just a collection of fields, possibly of different data types, typicially with a fixed number and sequences.

Records also takes types into account (.equals and .hashCode)

Big exception is that = and .equals are NOT the same when comparing Record to a map even with the same value.

dissoc a key from a Record returns a Map

It can be a bit surprising to see this. Unfortunately, they often still look like records. In fact, this is one of the reason record? exist.

Reasons you might use records

  1. Clear data semantics (you are naming things) (clara-rules)
  2. computed properties (midpoint of a circle, IShape, Circle, Rectangle)) (core.async)
  3. polymorphic 'actions' (Stuart Sierra's component)
  4. A clean simple way to create a named class implementating a interface
  5. (defrecord ForJava [...]:load-ns true...)

Mario Aquino

Showcased an API for interaction to the Alexa Skill system from the Clojure API. It is called Boomhauer, from the king of the hill character. GITHUB

  1. Interactions can be single exchange or can be stateful
  2. Alexa has two concepts Intent and slots
    • Intent - What you want to do GETHOROSCOPE
    • Slots - The "arguments" passed to a
  3. Uterances - How you might express the things you are interested in eg.
  4. There is a local development that you can do
  5. Mobile could provide a great way to make Alexa a real success.
  6. There are libraries that generate all the uterances you want from a grammar.
  7. There is a Certification process. Got to get approved like Mac Application.

This might be good for the sales reps. I mean, they are already wearing a headset, it would be cool if they could do things like take voice notes and make calls and all that stuff without even having to touch the screen.

Michael Drogalis

  1. "Peerless" in the sense that peers open direct line of communication between each other
  2. Zookeeper for keeping track of the entry's that have been added

I have no use for this, thought it was neat. It is basically a system for doing distributed computation in a peerless system.

Jack Dubie

Hiearchy of testing - [Decoupled, End to End, Lightweight, Simple]

  1. Unit Test
  2. API Test
  3. UI Test (Selenium) - Just test what is supposed to happen

How do you test that something was done without actually tying to a particular db?

Refresh the page after performing an action, you should have the same state as you had when you finished. Without tying to a particular thing you have proven that it has been persisted.

Stuart Sierra

  1. Removing a method definition does not remove it from the ns
  2. Macros if changed will not cause things using the macro to be re-evaluated
  3. Protocols don't reload because Java Classes are Immutable

Assumptions

  1. 1 file = 1 ns
  2. No circular dependencies
  3. No loading code outside of ns
  4. No fully qualified ns in variables, you must require everything

Dealing with Application state

  • RELOADED
  • COMPONENT
  • TOOLS.NAMESPACE

You can have multiple systems that are seperate "systems" in development and production

When you need development, just merge all the systems into one map

tldr; Source Code != Program

Tony Kay

UNTANGLED

Honestly, it looks rather complex to me. I do not convinved these new models based on Falcor are actually superior.

Bozhidar (Cider)

l - can be used to show a list of the locals
o - takes you out of the current debugger
s - stacktraces
which-key package -
http://cider.readthedocs.org/en/latest/
there is a really good story in terms of being able to trace recursive functions
enlighten mode basically enables lightable in emacs
cider-scratchpad is usual for prototyping ideas
C-c C-e for normal evaluation
C-j to print out the result
cider-inspect lets you look at complex data
cider-docs - to see docs
cider-grimoir - to see examples
cider-apropo - match all symbols related to the word you name
Projectile installed allows you to toggle between implementation and test

Questions

Can you instrument the debugger from API?

Yes.

Can you debug Clojurescript?

No.

Zach Tellman (Clojure Applied)

  • The extra verbosity of using standard functions rather than ...
  • Always be composing - https://www.youtube.com/watch?v=3oQTSP4FngY
  • Dynamic Variables for Datastore & TaskQueue
  • with-redefs might be better? Not sure.
  • Most of the time you want to be verbose rather than cryptic.
  • It is better to duplicate code than to have the wrong abstraction

Arachne

Some modular web framework that is going to normalize how people do web programming.

Mikaela Patella

  • Web Developer -> Distributed Systems Engineers
  • The clients and the servers are all segments of a distributed system.
  • The "server" is an abstraction over the entire backend, a consistent snapshot of an uncertain distributed system
  • Big idea is that "Frontend" and "Backend" are relics of the past (We are really just distributed systems.)

Think of as games....

What if we thought of it less as "request/response" (webdev) programming and more as a game? Where we have to do local level rendering of a segment of the entire world.

Priyatam Mudivarti

  • Invalidation - How do you inform other users that the current information is no longer valid
  • Eviction - How long do I exist?
  • Naming - What is th ename of the cache
  • {cache-name}-{uid}-{cache-version}-{logical-timestamp}
  • In order to properly invalidate things, include a timestamp

So, for good caching, also include a timestamp as part of the UUID, this way you don't have to revert data, instead you can just increment the timestamp and this will mean the cache is no longer used. Thi smight actually apply to Elasticsearch for my own uses.

Alex Kehayias (Chocolatier)

Problem with conventional game engines is

  1. you intermingle state and behavior
  2. Not declarative
  3. No Interactive development

Entity Component system

  • Dungeon Siege & Unit Game Engine
  • Basically, it is a map of components (interfaces) that it supports
  • Devcards - This guy had a good experience with devcards.

Performance

  • Variadic function scannot be optimized (use multiple arities instead)
  • apply has a real cost (it can not be optimized)
  • keyword-equal? is much faster
  • defmulti is slow, detype, defrecord, defprotocol is fast
  • AVOID INTERMEDIATE COLLECTIONS
  • If you now it is a boolean, skip test use ^boolean

Some great Resources at the end

Matthias Felleisen

  • All types think types while they create code
  • In some programs, we can check programs at compilation time
  • He is against Type Inference.
  • Hindley-Milner type inference (Ml, Haskell)

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Personal

Good conference. Met a number of people that we can bring in to work if we need their skills. Learned about new technologies in the Clojure community. Specifically, I think the Alexa system might be something we should look into for Reps. Specter might be good for keeping our system as Data and not needing to put everything in a database. The Data science team might like that; of course, it would involve learning clojure. I think that would be a win win for everyone. :]


« Renoir: Revered and Reviled A Fire Upon the Deep »

Copyright © 2020 Stephen Cagle