F# support would be nice
-
Tuomas Hietanen commented
Hello,
Here is a sample, Tomas has made software that calls F# compiler to parse syntax highlighting for a web page. Source code is also available. I think the same could be used with LINQPAD quite easily:
http://tomasp.net/blog/fswebsnippets-intro.aspx -
johnw commented
Since functional programming is fast growing in popularity it would be really grat to have autocomplete for f#. However I do realize that it may be difficult to implement.
-
RazerWolf commented
F# autocomplete would be a huge help. How about importing something like ANTLR or maybe even FParsec? :P
-
kcheick commented
I still get the same exception when querying the database
-
kcheick commented
I get an exception when I use quotation to query a database using the powerpack as explained in Don Syme blog: http://blogs.msdn.com/b/dsyme/archive/2009/10/23/a-quick-refresh-on-query-support-in-the-f-power-pack.aspx
here is the sample of code :
// dll imports
// FSharp.PowerPack.Linq
// FSharp.PowerPackopen Microsoft.FSharp.Quotations
open Microsoft.FSharp.Linq
open Microsoft.FSharp.Linq.Query
let dc = new TypedDataContext()
let test = query <@ seq {for product in dc.Products -> product.ProductName} @>
test
|> Seq.map (fun x -> x.Dump())I get this :
FileNotFoundException: Could not load file or assembly 'TypedDataContext_heyswu, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. -
kcheick commented
the highligting is wrong when specifying a generic type, i guess the rule for characters applies there since generic type in F# are specified with a '. you can see it in the sample below when defining Dump
// the 't is not necessary because of the type inference
let Dump (text:string) (x:'t) =
Extensions.Dump(x,text)
x// C#
//new[] { 11, 5, 17, 7, 13 } .Dump ("Prime numbers")
//.Where (n => n > 10) .Dump ("Prime numbers > 10")
//.OrderBy (n => n) .Dump ("Prime numbers > 10 sorted")
//.Select (n => n * 10) .Dump ("Prime numbers > 10 sorted, times 10!");// F#
[|11; 5; 17; 7; 13|] |> Dump "Prime numbers"
|> Array.filter (fun n -> n > 10) |> Dump "Prime numbers > 10"
|> Array.sortBy (fun n -> n ) |> Dump "Prime numbers > 10 sorted"
|> Array.map (fun n -> n*10) |> Dump "Prime numbers > 10 sorted, times 10!" -
kcheick commented
Very nice,
i just played arround for a couple of minute and looks good, like you said it is slower than the other query. i wonder if "fsi.exe" would be faster ?
And a little suggestion would be to add this defintion as defaultlet Dump = Extensions.Dump
so we can write
seq {1..10}
|> Seq.map (fun i -> i * 2)
|> Dumpinstead of
seq {1..10}
|> Seq.map (fun i -> i * 2)
|> Extensions.DumpGreat work man !!!
-
j2jensen commented
I still plan to do my database querying in C#. I'd like to learn F#, but I don't think I'll be very tempted to play around with it until I can execute snippets in LINQPad. It's annoying to have to create a whole visual studio project just to tinker.
-
Dan Puza commented
I would be interested, as a first step, just to have the ability to run some basic F# code snippets in LINQPad. Even it if wasn't fully supported (LINQ to database, full syntax highlight, etc).
That's assuming that it would not be a huge amount of effort (I don't know this) to "plug in" the bare bones F# implementation into the existing engine you have.
It could be listed in the drop down as something like "F# Statements (BETA)".
LINQPad has been a great LINQ and .Net learning/prototyping tool for me (I'm an experienced developer, but we all need to keep learning). And with the release of VS2010 I'm sure a lot of people are going to be interested in learning about F# (myself included). Of course there will be similar functionality in Visual Studio, so it doesn't make much sense to spend a ton of effort on this. But personally, I've been preferring working in LINQPad over Visual Studio since I discovered it! It's lightweight and convenient, very well designed. Great job on creating this wonderful tool.
-
Schuster-Rainer commented
go for it. its almost better than ... nothing ;-)
-
Syntax highlighting would probably be doable, as it requires writing just a lexer. Implementing red sqigglies would be quite a lot more work (as it requires a full semantic parser).
-
shuggycouk commented
just being able to run f# would be nice...
-
Schuster-Rainer commented
Having the opportunity to execute the scripts would be a very nice first itegration step. From my point of view the power of LinqPad comes from its handiness and slimness, being able to execute codesnippets with one dedicated key binding "F5". Its portable (I carry it out on my USB everywhere). So it would be a pleasure having a basic syntax highlighting within this great tool.
One more suggestion: Have you considered creating a Addin-Interface enabling users to add features? MEF could be a great deal
-
kcheick commented
With no lexical & semantic parser would that mean no syntax highlighting ?
-
Vin commented
Joe,
It would be immensely useful even to just add "F# code snippet/statements execution" support. I learnt Linq all by using Linqpad. I think I could learn F# very effectively if use the same tool to learn it, like I did with Linq.
I have talked to other developers and they think the F# support would be huge.
Big thanks to you for such a wonderful product.
Thanks,
Vin -
Would it be a problem if there was no autocompletion? Writing a lexical & semantic pariser - and a binder - is man-years of work. This is not viable unless there are some third-party libraries out there for lexing, parsing & (especially) binding.
-
kcheick commented
The ability to run F# snippet has definitely a higher priority for me.
Like Schuster-Rainer said, the integration of database query could be considered in a second phase. We could still do it by Importing manually the Powerpack. -
Schuster-Rainer commented
For me both features are very usefull. Snippets for executing, learning and discovering F#. But as your tool is widely used to query databases the integration of the according PowerPack Linq support should also be implemented. How about integrating the snippet feature as a first step and the database as a second.
-
Please comment on whether you just want to run F# code snippets, or use F# for querying a database!
Joe