Eekh, Lively looks too much like SmallTalk to me. Have you managed to
make sense out of it? I tried a few smalltalks in my life but never
"got it", maintaining and navigating hundreds of methods through the
class browser seems very distracting compared to module-centric
programming as in ML/F#.
> I would love to be able to edit F# in a live
> browser application and have that compile into my app immediately. :)
Yes many of us would! As things stand though WebSharper is not the
right tool for this kind of stuff. What you would want there is
IL-level translator that emulates complete .NET semantics (reflection,
generics, everything) in JavaScript. Such a system would be great for
running arbitrary .NET code but I imagine performance wouldn't the
best because of the overhead of representing everything. WebSharper
restricts itself to a tiny subset that is very close to JavaScript
itself, so there is little overhead but also no portability - we
definitely can't compile F# compiler to JS.
Another alternative of course is bypassing JavaScript altogether and
running the F# compiler code as is - in Silverlight. Have you tried to
embed FSC into it?
--
Kind Regards,
Anton Tayanovskyy
WebSharper™ - type-safe JavaScript in F#
http://intellifactory.com
--
--
Yes we've been encouraging single-domain programs with [<Rpc>] methods
that allow client-side to talk to the server. With 2.3 mobile
templates there's an option to go cross-domain and have a client call
an [<Rpc>] method from a different server, but yes, it is not
sufficiently advertised.
It took me a bit to figure out why do you mention InterfaceGenerator
in this context, is this because you believe code generation is
necessary to solve the problem?
A simple solution comes to mind that does not imply code generation:
(1) We define a service contract, say as an interface. Both clients
and servers have access to this definition.
type IWeatherService =
abstract member GetTemperature :
System.DateTime -> Location -> Async<float>
(2) The client uses the type of the service and a URL to construct a
proxy object that is later used as a normal object:
let weather = Remote.Proxy<IWeatherService> "http://weather-example.com"
async {
let! x = weather.GetTemperature System.DateTime.Now
"Harrisonburg, VA"
return ()
}
|> Async.Start
(3) The server uses the type of the service and an implementation to
add it to the table of supported services on a site (say as part of
sitelets).
Does this solve the decoupling?
Of course if we want to non-WebSharper clients or servers in the
picture this does not quite cut it. I would wait until type providers
come out of beta before tackling that, to do the code generation in
the type provider.
Thanks,
A
--
Thanks,
Adam.
On Tue, Nov 1, 2011 at 9:07 PM, Anton Tayanovskyy
--
Adam Granicz, IntelliFactory
www.intellifactory.com
Replacing the use of tables in formlets with lists would make me very happy, even if it's an option/setting. In practice, I've found lists to be far more flexible to layout with CSS and generally provide the number of hooks without abusing the semantics of the table element. As a default style, you can always use the table, table-row, and table-cell css options that are now supported by all major browsers.
It took me a bit to figure out why do you mention InterfaceGenerator
in this context, is this because you believe code generation is
necessary to solve the problem?A simple solution comes to mind that does not imply code generation:
(1) We define a service contract, say as an interface. Both clients
and servers have access to this definition.type IWeatherService =
abstract member GetTemperature :
System.DateTime -> Location -> Async<float>(2) The client uses the type of the service and a URL to construct a
proxy object that is later used as a normal object:let weather = Remote.Proxy<IWeatherService> "http://weather-example.com"
async {
let! x = weather.GetTemperature System.DateTime.Now
"Harrisonburg, VA"
return ()
}
|> Async.Start(3) The server uses the type of the service and an implementation to
add it to the table of supported services on a site (say as part of
sitelets).Does this solve the decoupling?
Of course if we want to non-WebSharper clients or servers in the
picture this does not quite cut it. I would wait until type providers
come out of beta before tackling that, to do the code generation in
the type provider.