Introducing the Famous Framework
blog.famous.org
blog.famous.org
Part of our decision to prioritize integration with other technologies/frameworks is so that more mature tools like Angular or React can do the heavy lifting on application logic while Famous focuses on animation and layout. We learned a lot about this balance from our time building Famo.us/Angular.
In other words, we're not trying to be 'everything for everyone' out of the gate, but we'd love to be 'something for everyone,' and the 'something' we're focusing on is what what Famous is good at: user interfaces, interactions, and animations.
It would also be great to see how Famous isn't a re-skin of MVC with a React-flavored API.
https://github.com/Day8/re-frame
It looks like Famous is going for something similar, but I'm not enjoying the reading nearly as much.
Of course, both re-frame (in ClojureScript) and Elm have the massive advantage of being in functional languages which allow for FRP, and embrace immutability by default.
Can't tell you what an advantage that is.
[1]: https://github.com/Famous/framework/tree/develop/lib/core-co...
Stackoverflow has lots of famous snippets.
Environment:
iPhone 5c iOS 8.3 Safari
1) Go to milk.samsung.com
2) Milk displays a message suggesting that you access the site from either a desktop or a 'select Samsung device'. For some insane reason though, they provide a link to "Go to milk.samsung.com.
3) Click the 'Go to milk.samsung.com' link.
Result:
You receive the error message, "You are still on the phone".
My conclusion:
If they know that I'm on a phone that they don't support, why give me another link milk.samsung.com??
We need to have a talk. First, this isn't dependency injection - you're passing in data. These "Behavior" functions may depend on the data, but that doesn't make this a dependency.
Oh, I can understand how you're confused. You see Angular doing it and reverse-engineered the term. But notice how in Angular it is used to pass services into controllers, services that the controller has a dependency on.
Also, notice how this "feature" is broken in production. Any website worth its salt will minify the assets, which changes function parameter names. You did notice that, right, that your clever little hack works great in your development environment but totally breaks when you minify your code? You are testing things minified, right?
Why would you spend any time at all working on a feature that is fundamentally broken in production? Kill your darlings.
In Angular you'd assign a property called $inject to make "DI" still work even with minification, so it's not really an issue.Or you can explicitly pass a array with dependency names when a service is registered.
So there is no issue here.
Now I don't know how Famous works and i'm not interested in using that 2M dollars vaporware. I'm just saying.
To the down voters:
Function(numberOfStates) is a function call with data being passed in.
Function(stateMachineFactory) is dependency injection.
Would you mind clarifying this distinction as you see it?
As far as I can see, x depends on y if and only if y is a dependency of x. This would make the States that Behaviors depend on a 'dependency,' based on your statement above that 'functions ... depend on the data [States].'
These State dependencies (if we can agree on the term) are injected dynamically based on the names of the parameters in the Behavior functions. I'm not one to bike-shed on terminology, but I do think it's fair to say that we have dependencies that we're dynamically injecting. If it looks like a duck and quacks like a duck, it's probably a duck.
Perhaps the distinction you're flagging on vs Angular is that Angular injects a reference to the dependency, whereas Famous injects the value of the dependency?
If your function operates on data, it's "passing in data" and not "dependency injection". Hell, otherwise, every function call would involve dependency injection!
Behaviors in BEST are a functional programming construct—they project streams of data into a return value. Note that Behaviors are automatically re-evaluated every time one of their dependent States change, which introduces this 'stream' functionality.
I'd argue that these streams are dependencies and that they're being injected into these functions (hence DI,) but honestly, at this point we're just bike-shedding about terminology :-).
I do want to make sure, though, that this functionality is properly communicated, as the State-Behavior relationship is the crux of our framework's design.
However, you could consider that the caller of the function could have had the stream injected, depending on the perspective of the rest of the application.
For instance in pseudocode:
useData = (data) ->
munge(data) + calculate(data)
setupPipeline = (input, output) ->
input
.pipe cleanup
.pipe useData
.pipe format
.pipe output
application = ->
setupPipeline stdin, stdout
test = ->
setupPipeline mockInput, mockOutput
Notice how I've included the test case to illustrate how the dependency injection enables testability, which is critical to understanding the concept. Without DI, the setupPipeline method would take no parameters and explicitly hook to stdin/stdout.Contrast this example with the standard case of regular-old-data-passing:
useData = (data) ->
munge(data) + calculate(data)
application = ->
useData stdin.getInt()
test = ->
assert.equal -1, useData 42
assert.equal 0, useData 100
assert.equal 1, useData 99
Note how inversion of control is not necessary to unit test this function, which is the indication that there is no dependency injection going on there.If you were using dependency injection for the behaviors, it would imply that the injection is not strictly necessary, and you could instead write the function with a hard dependency. Since the behavior just takes data that whole idea is nonsensical. What would it bind to? Nothing. It's just taking data.
The web community has been done a great disservice by people popularising the phrase "MV*".
Tell me what it is.
Tell me what it is.
Tell me what it is.
Tell me what it is.
Tell me what it is.
Oh.
Inspired by turtles, LEGO and ICs, k...
"Or with JavaScript in general" -- there's a hint
"Web Frameworks: Given that we're building a web framework" -- well, I wouldn't call it a given, but -- mystery solved!
There are some open source projects that adds turn key components to famous, like famous-flex https://github.com/IjzerenHein/famous-flex by Hein Rutjes. If you want demo's, then there's the famous "fan site" http://famousco.de/links/
I thought it used WebGL to render animations.
This is not specifically directed at Famous... Why don't you [framework creators] show off REAL freaking apps? Show me a reasonably sized application that handles sophisticated user interactions. How do you handle routing? Data fetching / caching? Production builds? Testing environment? Dealing with your everyday CRUD? It's alright if your framework is meant as a framework that only handles some specific things, show a real-world example of the framework to highlight how it makes things easier/better/simpler/faster. I don't want to see TodoMVC or single-file examples. I know it's absolutely NOT sexy, but it's most of what I'll be having to deal with in my day-to-day work as a developer. (The only frontend framework that I know of that does a tremendous job at this is ember. I don't use ember, but I have nothing but the utmost respect for its developers.)
Specifically to famous: You touch on the topic of building large applications with Famous in this link. Your lack of reference applications (although not necessarily unreasonable, as you just announced the alpha) does nothing to gain my trust as a developer. I'd love to see a non-trivial example application that shows the full picture of what an app would look like.
[0] http://famous.org/framework/ [1] https://github.com/Famous/framework/tree/develop/lib/core-co...
It really bugs me in this day and age, that frameworks are build without async client-server being a first-class behavior at least by example.
While I really appreciate the various demos for say TodoMVC, which allow some framework comparison.... what I would love to see (from TodoMVC or similar) would be an abstracted interface that is expressly async (even if only using setTimeout) via callbacks or promises for the data access. It's part of the story that is very important. Also, a very simple router... perhaps requiring a hello/login/register screen (user:user) and the todo screen.
I know TodoMVC was supposed to be just trivial enough to show something between the various frameworks... that said, I think we really need just a hair more.
The web needs something like Apple's Cocoa or Cocoa touch - a very rich GUI toolkit. It looks like this takes some inspiration from that, as some of the names are same. I don't know if it has an solver-based auto layout engine, though.
Anyways, I've been wanting something like this for a while now, as no company has really stepped up to the plate with a real GUI toolkit.
This framework isn't gonna be ... famous.
Which has the gem: "Check out the 'Hello World' example below. When reading through the code, think of the tree as Famous-enhanced HTML and the behaviors as CSS styles on steroids."
So "behaviors" are styles? Why is the first line of a "Hello World" example a load of styles I don't understand?
And it's even more confusing: It talks about "components" but there are IDs which means any resuse would duplicate those IDs on the DOM (I think?) which isn't valid html.
Famous, AngularJS, Polymer, React, RiotJS, CanJS, ... All really great options.
I think Famous will have trouble competing with React, Polymer 1.0 and the upcoming AngularJS 2.0 in the current 2D browser-based market. I think if something like Microsoft's hololens gains traction, Famous would greatly benefit - Its 3D features would help it stand out.
Most of the value of a 3D interface is lost when you project it on a 2D screen.
Got it after watch the Website:
"The Famous Framework is a new JavaScript framework for creating reusable, composable, and interchangeable UI widgets and applications. It balances declarative with imperative and functional with stateful, and it's built on top of the Famous Engine."
It does look like a cool JS framework though.
Things do move fast, but hype doesn't move that fast. The reason I'm cautious is that they were extremely hyped before being able to deliver any actual code developers could use and that in the time since the original announcement, well, all of the past two and a half years happened (e.g. React).
[0]: https://web.archive.org/web/20130715000000*/http://famo.us
EDIT: Here's the January 2013 beta marketing website: https://web.archive.org/web/20130110063331/http://famo.us/
If I had to guess, I think some of the first web-related work (on what post-MVC web will look like) began several years ago when 'reactive' programming started becoming a hot topic.
Since it seems a new JS framework comes out pretty much every week, and some people express frustration in trying to filter through the noise, I would say to them that this one is definitely one to keep an eye on.
Javascript and PHP frameworks are all built on top of a language that does everything you need for the web before you even start the framework. Frameworks in both languages are basically an exercise in arranging things according to your personal preferences...and people have a wide range of preferences.
Which is why I prefer React over Batman, Ember and Angular.
Btw, I feel like their concept of Behaviour Tree doesnt' really fit in with the Behaviour Tree's I read about.
And even if it were, it's possible to have a useful response beyond a webcomic link that every idiot posts when anything new happens.