Would the same expectation be in place of my examples were in JavaScript? I doubt it.
3,196 karma · joined March 18, 2009
Brian McKenna
http://brianmckenna.org/
http://twitter.com/puffnfresh
Senior R&D Engineer at Precog.
Would the same expectation be in place of my examples were in JavaScript? I doubt it.
Marketplace is Atlassian Marketplace, a real website, REST API and bunch of frontend components. If it's not part of an architecture, what is it?
I did simplify Commerce, the system is Atlassian Commerce Cloud Platform. I apologise that I simplified the name for an example, which has confused you.
I show them the png image.
Did you read the part about generating diagrams from different things, e.g. service descriptors, service proxies, tests?
data Version = Current | Future
generate :: Version -> Diagram
Implementation uses a few if/else expressions. Really simple.The final points of the post was that we should be able to generate architecture diagrams from other code. Parsing a service descriptor, generating them from tests, etc. You DO need a programming language.
Sorry for the problems - I was hotlinking to the awesome http://rawgit.com/ website during development and forgot to remove it before posting it on Twitter.
The website should be fixed in just a few seconds. Thanks for trying it out!
The Quirrel language is much more high level than the API for ElasticSearch. It comes with things like machine learning (e.g. clustering and linear regression):
http://precog.com/developers/how-tos/machine-learning/
Even without libraries like machine learning, you can write somewhat readable queries which do some impressive things:
It's an analytics platform for big data. Basically, you upload lots of JSON, use the custom language (http://quirrel-lang.org/) for analytical queries and the platform will handle efficient storage and querying of your data.
There are also has extras like a library for charting and reporting query responses using JavaScript and an IDE for writing Quirrel and uploading data.
Absolutely false. Try TDD in Haskell. Know how many mocking libraries there are in Haskell? None. Totally unnecessary.
You have to use asymptotic analysis to figure out that it's O(n^3) but can actually be performed in O(n) - then write the derived code from your analysis. Nothing has changed.
Customers care; transitively.
http://licentious.herokuapp.com/
https://github.com/pufuwozu/licentious
Here's a programming language competition that I organise:
The web framework that I use is Yesod. Over the years I've used CakePHP, Django, Rails, Lift and Play! - Yesod is definitely the BEST framework I've used:
> Analysis is the method for writing code that satisfies our constraints. Neither TDD nor types are the single answer to writing code that does what we want.
Higher level languages are easier to optimise for. Creating a bytecode would also mean another backwards compatibility hell and another format is not as general as people would like.
It allows you to write code like this:
val query = "Brian"
val result = for {
db <- connectToDatabase
user <- userFromDatabase(db, query)
friends <- friendsFromDatabase(db, user.friends)
} yield friends
Whenever one of the functions above returns an error, the whole expression is that error. The outcome is either an error (if there was any) or the end value of Set[User]. No need to manually handle an error until you get to the end result.The analogy is that callbacks create non-linear control flow. Using a monadic syntax like in Roy, we can easily have callbacks without having them look non-linear:
let deferred = {
return: \x ->
let d = $.Deferred ()
d.resolve x
d.promise ()
bind: \x f -> x.pipe f
}
let v = do deferred
hello <- $.ajax 'examples/helloworld.roy'
alias <- $.ajax 'examples/alias.roy'
return (hello ++ alias)
v.done console.log
Which compiles into continuation passing: var deferred = {
"return": function(x) {
var d = $.Deferred();
d.resolve(x);
return d.promise();
},
"bind": function(x, f) {
return x.pipe(f);
}
};
var v = (function(){
var __monad__ = deferred;
return __monad__.bind($.ajax('examples/helloworld.roy'), function(hello) {
return __monad__.bind($.ajax('examples/alias.roy'), function(alias) {
return __monad__.return((hello + alias));
});
});
})();
v.done(console.log);
Anyway, continuations (with call/cc) are definitely a controlled form of goto. Take a look at an example from Paul Graham:http://lib.store.yahoo.net/lib/paulgraham/cint.lisp
((call/cc
(lambda (goto)
(letrec ((start
(lambda ()
(print "start")
(goto next)))
(froz
(lambda ()
(print "froz")
(goto last)))
(next
(lambda ()
(print "next")
(goto froz)))
(last
(lambda ()
(print "last")
(+ 3 4))))
start))))What you're talking about now is totality. Both Haskell and Clojure allow non-total functions (functions which may not return a result) - the checking that they do are to stop undefined results. Agda is an example of a language that only allows total functions.
That doesn't really make sense to a type theorist. The definition of "type-safety" is only applicable statically.
What checking is done at runtime?
I'm a huge type safety fan (see http://roy.brianmckenna.org/) so this is pretty amazing. I'm definitely going to play around with Ambrose's work.
Had a quick look, it's really exciting that the algo.monads was almost completely type-checkable with this system.
Leaves me with a couple of questions:
Multimethods are untyped. Anyone able to comment on how often multimethods are used in idiomatic Clojure code?
Anyone know if this work could eventually allow protocols to become full type-classes (allowing dispatch based on return type of protocol methods)? Am I misunderstanding how protocols are compiled?
Hopefully the videos for Typed Clojure at Clojure Conj 2012 will be posted soon after the talk is given :)
My only fear is that optional typing would be less useful than optional untyping. When you have libraries that are untyped, they're a pain to use from a typed language. The other way around is not true.
https://github.com/pufuwozu/osxmonad
So I was really interested in trying out this fork. A couple of problems:
* Doesn't look like tiling is automatic, you still have to tell each window which side of the screen to tile on (by using Command+Option)
* I was using it for a minute before it crashed - which I didn't even notice
If those two little problems were fixed I think I could definitely use this until I get my version of Xmonad working properly.
Multimethods would be an alternative to this type of ad-hoc polymorphism. I've encoded immutable multimethod environments in my new library, bilby.js:
https://github.com/pufuwozu/bilby.js
Lets you write things like this:
var env = λ.environment()
.method('length', λ.isArray, function(a) {
return a.length;
})
.method('length', λ.isString, function(s) {
return s.length;
})
.property('empty', function(o) {
return !this.length(o);
});
env.empty([]) == true;
env.empty([1, 2, 3]) == false;
Where isArray and isString are any functions that return true/false based on the input arguments. The environment then dispatches whichever method that has a predicate return true first. map :: (a -> b) -> [a] -> [b]
Interfaces can't provide this type of code reuse.https://github.com/pufuwozu/bilby.js
The syntax examples show off a bit of everything:
Monads:
λ.Do()(
λ.some(1) >= function(x) {
return x < 0 ? λ.none : λ.some(x + 2);
}
).getOrElse(0) == 3;
Kleislis: λ.Do()(
function(x) {
return x < 0 ? λ.none : λ.some(x + 1);
} >> function(x) {
return x % 2 != 0 ? λ.none : λ.some(x + 1);
}
)(1).getOrElse(0) == 3;
Functors: λ.Do()(
λ.some(1) < add(2)
).getOrElse(0) == 3;
Applicatives: λ.Do()(
λ.some(add) * λ.some(1) * λ.some(2)
).getOrElse(0) == 3;
Semigroups: λ.Do()(
λ.some(1) + λ.some(2)
).getOrElse(0) == 3;