-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfeed.xml
1182 lines (852 loc) · 90.2 KB
/
feed.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>F# Reflections</title>
<description>Blog about F# and FP Programming</description>
<link>http://localhost:4000/</link>
<atom:link href="http://localhost:4000/feed.xml" rel="self" type="application/rss+xml"/>
<pubDate>Tue, 27 Aug 2019 23:25:18 +0200</pubDate>
<lastBuildDate>Tue, 27 Aug 2019 23:25:18 +0200</lastBuildDate>
<generator>Jekyll v3.8.3</generator>
<item>
<title>Behind the F# editor tootling. Part 1: introduction to compilers.</title>
<description><h1>Behind the F# editor tootling. Part 1: introduction to compilers.</h1>
<p>F# editor tooling, while it’s not on the level of mainstream languages like C# or Java, has been in a unique spot among Functional Programming languages. F# tooling is available cross-platform, it’s feature-rich, stable, innovative and, what’s also essential, it’s commercially supported and actively developed. Moreover, all this is available while communities of some other FP languages are discussing whether displaying simple tooltip is not too expensive.</p>
<p>In the series, I’d like to dive behind what we see in the editor and show some of the magic that lets us have this excellent developer tooling experience. In this post I’d like to do a gentle introduction to compiler design, introduce some concepts and vocabulary that will be useful later, and give a general description of the potential approaches to the editor tooling in context of compilers.</p>
<!--more-->
<blockquote>
<p>Please keep in mind that this post is a high-level introduction to the concepts with some simplifications and without too many details. If you’re one of a few people that work on compilers or editor tooling this post is probably not for you ;-)</p>
</blockquote>
<h2>Compilers 101</h2>
<p>If you ever took university course about compilers or read any introductory book to the topic you probably know that compilers are often treated as a black box - compiler takes a list of files, some options, do magic, and then it outputs some executable or library.</p>
<p>Typically inside the compiler, several things are happening in order:</p>
<ul>
<li>Lexing - it’s the process that transforms text (source code) into a list of tokens that can be understood by the compiler</li>
<li>Parsing - it takes the list of tokens produced by lexing and transforms it into Abstract Syntax Tree (AST). AST is a tree that represents the structure of your code. Each node of the tree denotes a construct occurring in the source code. The syntax is “abstract” in the sense that it does not represent every detail appearing in the real syntax, but rather just the structural or content-related details. For example, construct like an if-condition-then expression may be denoted as a single node with three branches. Parsing can produce errors if your code contains structural errors (for example, missing parentheses, or wrong indentation)</li>
<li>Typechecking - In a statically typed language, it’s a process of verifying and enforcing the constraints of the types. Usually it takes as an input AST and any additional context (for example external references) and ensures that everything is fine with your code regarding type system - for example, it checks what types are variables you use, if they contain the members you use if your function returned declared type. A result of type checking is a different type of the syntax tree - in F# compiler we call it Typed Abstract Syntax Tree (TAST). TAST is built on a higher level of abstraction - it contains fewer details about the structure of the code, but more information about entities (variables, objects, functions, etc.) including full type information. Type checking can produce a lot of different types of errors and is one of the primary sources of them.</li>
<li>Optimisations - is a process where compiler perform a different type of optimisations on your code such as removing dead code or inlining. Every optimisation is taking TAST as an input and returns new TAST as an output, and the process is repeated as long as the output TAST is different from input one.</li>
<li>Code generation - it’s the final step of the process, in which compiler takes final TAST and generates output code from it (either in the form of the byte code of some form - IL in case of F# - or just native code)</li>
</ul>
<h2>Compiler 101 vs editor tooling</h2>
<p>Unfortunately, the naive, black-box approach to the building compilers is not enough. With such design, you can only start getting information about code only after code is built, inspecting the final result. It is problematic for multiple reasons:</p>
<ul>
<li>You don’t have any information connected to the structure of code - you only have final results. It may be suitable enough to get some tooltip information or maybe a list of usages of the given Symbol, but it’s not enough in case of any editor features depending on code structure (refactorings, autocomplete lists, formatters etc.)</li>
<li>You only have up-to-date information about your code after you’ve saved the file and built project - for example, you don’t get updated errors in your code while you’re typing and making changes in the file</li>
<li>Saving the file and building a project usually takes a while - if our compiler process is entirely stateless it needs to perform all phases. Also, everything has its costs. Especially optimisations and code generation is not interesting for us from editor tooling point of view - we want to provide tooling in a context of the source code we edit, not in the context of optimised, final artefact we get from the compiler.</li>
</ul>
<p>Due to those problems editor tooling for languages using a black-box design of the compiler usually have huge problems - either they’re limited in what’s possible in such editor tooling, or attempt to work around those problems by re-inventing what compiler does by using technologies such as tree-sitter or just by writing “presentation compiler”.</p>
<p>However, such workarounds are never as accurate and fully featured as systems based on the compiler directly. While building performant, accurate and productive editor tooling, we need to have direct access to the internal state of a compiler (such as AST, TAST, and Symbol information) and that’s why we need a different approach to building compilers.</p>
<h2>Modern compiler design</h2>
<p>In recent years many mainstream programming languages have moved towards compiler service approach to the editor tooling. In such approach, editor tooling is powered by internal capabilities of the compiler which ensures that editor functionality. Examples of such approach are [C# Roslyn API] or [F# Compiler Service] (on which we will focus more in the next parts of this series).</p>
<p>The modern compiler needs to be:</p>
<ul>
<li>API - compiler needs to be accessible as a normal library or some other kind of API. We need to be able to run it inside another process, and we need to be able to communicate with different layers of a compiler (usually lexer, parser and type-checker)</li>
<li>Server - it needs to be ready to run as a long-running, stateful application that gives us the ability to do partial operations (for example single file parsing) in the context of a whole compilation unit. The fact it’s the stateful, long-running and asynchronous process has vast implications on the design of compiler and the performance optimisations.</li>
<li>Database - as mentioned above compiler is a long-running stateful process. Additionally, we need to have a way of getting what is usually internal information of the compiler - Tokens, AST, TAST, list of known by the compiler symbols and more.</li>
</ul>
<p>With such compiler capabilities, we can host it directly in editor process (for example F# or C# tools in VS) or in another application providing higher-level API that is also communication layer which can be used from editors (for example language server using Language Server Protocol)</p>
<h2>Summary</h2>
<p>I hope this blog post is good enough, the high-level introduction of compiler design, concepts and vocabulary that you’ll need to know in the future posts from this series.</p>
</description>
<pubDate>Tue, 27 Aug 2019 00:00:00 +0200</pubDate>
<link>http://localhost:4000/F-Editor-Tooling-Part1</link>
<guid isPermaLink="true">http://localhost:4000/F-Editor-Tooling-Part1</guid>
<category>F#</category>
<category>Tooling</category>
<category>Compiler</category>
<category>FSharp.Compiler.Services</category>
</item>
<item>
<title>Ionide — Introducing Info Panel</title>
<description><h1>Ionide — Introducing Info Panel</h1>
<p>Today, I’d like to talk about a new feature called the Info Panel that has been
released in Ionide 3.36. For me personally, it’s one of the most exciting
features we’ve introduced in Ionide so far. Hopefully, it will help F#
developers as nicely as placing function signatures in CodeLenses or fast
cross-project navigation powered by background symbol caches.</p>
<!--more-->
<h4>The problem of API exploration</h4>
<p>One of the biggest problems some software developers have is remembering all the
functions, classes, and namespaces that are available in a vast set of
dependencies they use, or even that are present in their code bases. Some IDEs
try to help with that problem via tooltips or IntelliSense.</p>
<p>However, these solutions suffer from two problems. First, the visual help they
have is temporary. Second, tooltips can sometimes feel intrusive. It’s sometimes
quite common to have something pop up and hide code below it, and if you move
your cursor the information changes are disappears.. Also, tooltips or
additional IntelliSense popups are typically small — the IDE has to play a
tricky game of tightrope where it needs to display useful information, but do so
subtly enough not to feel intrusive.</p>
<p>One alternative to an Info Panel exists in Visual Studio today, called the
Object Browser. It’s a separate window that presents a tree view of references
to a project where you can dive into constructs as-represented in their compiled
form. Although this is helpful for exploring references, it’s conceptually
detached from your codebase. Imagine a situation when you’re reading your code
and notice a function call that you don’t understand — it’s not as easy to use
Object Browser as just hover over the symbol — you need to click through library
content, to find appropriate class or function. And if you want to move to
another function next line, you need to do the same.</p>
<h4>Rich API exploration</h4>
<blockquote>
<p>The Info Panel is inspired by <a href="https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/LookingupObjectDocumentation.html">XCode’s Quick Info
Inspector</a>.
Thanks a lot to Dave Thomas for familiarizing me with this feature. BTW, you can
support Dave — one of the best F# OSS hackers — on his <a href="https://www.patreon.com/7sharp9">new Patron
page</a>!</p>
</blockquote>
<p><img src="https://cdn-images-1.medium.com/max/1000/1*G5A8JkkI0bIa4iK4M49CEA.gif" alt="" /></p>
<p>Info Panel is an attempt to bridge those two ways of presenting information. It
combines the interactivity of tooltips with the less intrusive UI of a separate
display panel. The panel auto-updates as you navigate through your code, but you
can also navigate information via the panel, independently of the code you’re
looking at.</p>
<p>By opening the Info Panel in VSCode, you can display rich information about the
current symbol under your caret, such as its signature, nicely formatted XML
documentation, its members, properties or functions, used attributes,
implemented interfaces. Because it’s a separate panel, the information is
persisted and doesn’t overlap with your code window. There is enough space to
provide quite a lot of nicely formatted information. It also supports link
navigation. For example, if somewhere in the documentation <code>DateTime </code>is
present, you can click on it, and move to the documentation about the <code>DateTime
</code>type. The Info Panel uses a combination of data from the compiler service and
XML documentation, so it works for both external dependencies and your own code.</p>
<p><img src="https://cdn-images-1.medium.com/max/1000/1*_R6bkfNHTGVXVqAK01lHbg.gif" alt="" /></p>
<p>Info Panel may update its content on the cursor move or on the hover (it’s
configurable) but also supports locking — the state in which the content won’t
be updated by normal action but only by click link or forcing update with a
command. This means that you can keep information that is interesting for you
while moving through a code base.</p>
<p>One of the additional options is complete replacing tooltips — when it’s
activated you won’t see normal tooltips when you put the mouse over the symbol,
only Info Panel will be updated (feature <a href="https://twitter.com/strmpnk/status/1123042142694383617">suggested by Brian
Mitchell</a>).</p>
<blockquote>
<p>Check all possible options for Info Panel in VSCode — they all start with
<code>FSharp.infoPanel</code> prefix</p>
</blockquote>
<h4>What’s next?</h4>
<p>Info Panel is in pretty good shape today however there are still a couple more
features that I want to add in a future:</p>
<ul>
<li>Handling namespaces — currently we don’t display any information for namespaces.</li>
<li>Navigation history — I think it would be nice if go back/forward commands were
implemented</li>
<li>Navigation breadcrumb — breadcrumb UX in VSCode is pretty nice for navigating
through the code base, I can imagine having something like that for the
documentation exploration. (suggested by Nino Floris)</li>
<li>More information for the symbols — we could potentially add even more
information such as inheritance hierarchies, declaring entities etc.</li>
<li>Investigate how Info Panel can be used for replacing/enhancing IntelliSense</li>
</ul>
<p>If you’d be interested in helping there are two places where you can start:</p>
<ul>
<li>If you’d want to improve generated documentation take a look
<a href="https://github.com/fsharp/FsAutoComplete/blob/master/src/FsAutoComplete.Core/DocumentationFormatter.fs">here</a></li>
<li>If you’d want to improve UX around the feature take a look
<a href="https://github.com/ionide/ionide-vscode-fsharp/blob/master/src/Components/InfoPanel.fs">here</a></li>
</ul>
<h4>Summing up</h4>
<p>I really hope you will like this feature — from my point of view, it fits into
Ionide design of finding good ways to provide as much useful information as
possible to the users — such as Code Lenses or rich tooltips we have right now.
Try it out, and let us know what you think!</p>
<hr />
<p><em>You can support Ionide development on *<a href="https://opencollective.com/ionide">Open
Collective</a></em>.*</p>
<p><img src="https://cdn-images-1.medium.com/max/1000/1*[email protected]" alt="https://opencollective.com/ionide" /></p>
</description>
<pubDate>Mon, 06 May 2019 00:00:00 +0200</pubDate>
<link>http://localhost:4000/Ionide-Introducing-Info-Panel</link>
<guid isPermaLink="true">http://localhost:4000/Ionide-Introducing-Info-Panel</guid>
<category>F#</category>
<category>VS Code</category>
<category>Tooling</category>
</item>
<item>
<title>Ionide — A New Hope</title>
<description><h1>Ionide — A New Hope</h1>
<p>You probably know that one of my <a href="http://kcieslak.io/Future-of-F-Cross-platform-editor-tooling">biggest
problems</a>
with the F# ecosystem and OSS work I’ve been doing has been lack of any
sustainability strategy. I’ve attempted to change that by creating <a href="https://opencollective.com/ionide">Open
Collective page for the Ionide</a>,
and at the same time, I’ve started talking with existing partners about possible
ways of making work on this crucial parts of the ecosystem more sustainable.</p>
<p>Today, I’m really happy to announce that for the next few months I’ll be working
full time on the F# open source, cross-platform tooling focusing mainly on
<a href="https://github.com/ionide">Ionide</a> and
<a href="https://github.com/fsharp/FsAutoComplete">FsAutoComplete</a>. This is possible
thanks to the partnership between my company — <a href="https://lambdafactory.io/">Lambda
Factory</a> — and Microsoft.</p>
<!--more-->
<h3>Scope of the work</h3>
<p>The contract with Microsoft will enable me to work on certain strategic goals of
the Ionide and FsAutoComplete that are important for both the F# community and
Microsoft. Our initial goals for the next few months are:</p>
<ul>
<li>Finishing <a href="https://microsoft.github.io/language-server-protocol/">Language Server
Protocol</a> (<a href="https://medium.com/lambda-factory/future-of-f-cross-platform-editor-tooling-a8cf62a50053">read more
about
LSP</a>)
implementation in FSAC and plugging it into Ionide</li>
<li>Fix performance reliability issues after triage and full performance
rebaselining after LSP support is in</li>
<li>Work on porting all components to .Net Core/Standard and using .Net Core version
of FSAC by default in Ionide to improve the getting started experience</li>
<li>A potential stretch goal is working on improvements to the scripting experience
in Ionide</li>
</ul>
<p>These goals are trying to tackle some of the most important issues of the F#
cross-platform tooling ecosystem, and will benefit not only Ionide but will have
an impact on other tools that F# developers use every day.</p>
<h3>Relationship with Open Collective</h3>
<p>I’ve been asked by some people who heard the news a few days ago if this affects
the Ionide OpenCollective effort. In short, no, but I’ll clarify some specifics.</p>
<p>From my point of view, this doesn’t change anything with respect to
OpenCollective. One of the reasons why we’ve decided to choose Open Collective
(over Patreon or PayPal donations) is the fact that it’s about supporting the
project, not any particular creator. Open Collective is a fund for the Ionide
project itself, with a transparent invoice system that ensures any withdrawals
are public. This allows any Ionide contributor, not just me, to spend dedicated
time on the project in the future. It is a long-term sustainability plan for
Ionide.</p>
<p>Contract with Microsoft is task-based — hopefully, it will result in fixing some
of the biggest issues with the Ionide and FSAC that we have right now but is not
creating long term sustainable environment — something I want to create with
Ionide as an organization and with Open Collective.</p>
<p>I hope that F# community will continue supporting Ionide on Open Collective as
generously as right now — and I hope that soon, I’ll be able to do some
announcements about how we will spend those funds on the project related goals
such as promotion, documentation and more. But that will come later, as I’ll be
quite busy in the coming months improving Ionide by working with Microsoft.</p>
<h3>But Embrace, Extend, and Extinguish…</h3>
<p>Ionide is still and always will be MIT licensed project owned by F# community,
and FsAutoComplete is and will always be Apache 2.0 licensed project owned by F#
Software Foundation.</p>
<p>Microsoft is not acquiring Ionide, nor is there any additional stipulations or
attempts to re-prioritize the direction of the Ionide project. In fact, I was
asked to help define the scope of the work and I’ll be helping decide what the
most important issues are to fix. To be clear, Microsoft is not gaining control
on Ionide, and they don’t gain any decision making power different than regular
F# users. Ionide is still a community project and the maintainers continue to
decide what gets added or removed.</p>
<h3>Next few months will be fun…</h3>
<p>I need to say that I’m really really happy to have this opportunity — for last
few years I’ve been saying that it would be really good for an ecosystem if
someone was working full time on F# cross-platform tooling. <br /> My goal for the
last few years has been pointing out that there is huge potential in F#
cross-platform tooling, in VSCode as an IDE platform, in F# Compiler Services
that’s the common infrastructure used by all F# tooling, and that’s been fairly
unique project among Functional Programming languages. I really believe that we
can make F# tooling best-in-class (of FP languages), and I hope that the
partnership with Microsoft is a step in this direction. However, we still need
to remember that F# tooling is owned by the F# community and only together we
can make it better so… contributions are welcomed!</p>
<blockquote>
<p>Additionally, I need to thank Phillip Carter (F# PM @ Microsoft), without his
help, and his advocating for F# inside Microsoft things like that would never be
possible. Thanks!</p>
</blockquote>
</description>
<pubDate>Sun, 24 Mar 2019 00:00:00 +0100</pubDate>
<link>http://localhost:4000/Ionide-New-Hope</link>
<guid isPermaLink="true">http://localhost:4000/Ionide-New-Hope</guid>
<category>F#</category>
<category>VS Code</category>
<category>Tooling</category>
</item>
<item>
<title>PureScript on Azure Functions</title>
<description><h1>PureScript on Azure Functions</h1>
<p>Serverless architecture is one of the hottest topics in cloud computing,
allowing developers to build and run applications and services without thinking
about the servers actually running the code, providing a scalable model for
building distributed, event-driven systems, as well as significantly reducing
operational costs.</p>
<p>Microsoft’s take on the serverless problem is service called <a href="https://docs.microsoft.com/en-us/azure/azure-functions/">Azure
Functions</a>. Out of the
box, it supports .Net languages (C# and <a href="https://fsharp.org/">F#</a>), Python, Java
and JavaScript. The last one is very important, as nowadays there exist a wide
variety of languages that can compile down to JS. And today, I’ll talk about one
of such languages — PureScript.</p>
<p><a href="http://www.purescript.org/">PureScript</a> is a strongly-typed, purely functional
programming language heavily inspired by <a href="https://www.haskell.org/">Haskell</a>. It
supports a set of advanced language features such as higher kinded types, type
classes, row polymorphism and many other features I don’t understand.</p>
<!--more-->
<h4>Requirements</h4>
<p>To get started with Azure Functions and PureScript you need to install several
dependencies. First of all, you need <a href="http://nodejs.org/">Node.JS and NPM</a> as it
is the runtime for Azure Functions, and is used by the PureScript toolchain.
Secondly, you need PureScript itself — you can download and install it using npm
with <code>npm install -g purescript</code>. Next thing is some additional PureScript
tooling, you can get it with <code>npm install -g bower pulp</code>. In the end, you also
need to install Azure Functions tooling that will enable you to build and test
your serverless application locally. This tooling can be found on GitHub —
<a href="https://github.com/Azure/azure-functions-core-tools">https://github.com/Azure/azure-functions-core-tools</a>.</p>
<h4>Getting Started with Azure Functions</h4>
<p>We will start by creating a simple JS function. In the local folder run <code>func
init MyFunctionProj</code>. When prompted, use the arrow keys to select a <code>node</code>
worker runtime from the language choices. This will create a new folder and a
new NodeJS Function Application inside. Inside the new folder initialize new NPM
project in it with <code>npm init</code>. After you’re done with answering all the prompts,
we will create our first endpoint — <code>func new — name MyHttpTrigger — template
“HttpTrigger”</code>.</p>
<blockquote>
<p>Without going into details, Azure Functions is an event-driven system that
supports multiple different types of triggers and bindings. The template we’ve
chosen will create simples possible function that is triggered by an HTTP
request and returns an HTTP response. If you want to learn more about possible
triggers and bindings visit Azure Function documentation —
<a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings">https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings</a></p>
</blockquote>
<p>After all those operations are done you should have following folder structure:</p>
<pre><code>MyFunctionProj
| — MyHttpTrigger
| | — index.js
| | — function.json
| — node_modules
| — host.json
| — package.json
</code></pre>
<p>You can now test your first Azure Function! Run in terminal <code>func host start</code>
and wait a moment. After everything is initialized you should see (among other
things something like: <code>MyHttpTrigger: [GET,POST]
http://localhost:7071/api/MyHttpTrigger</code>. You can now visit this URL and see
some output in the browser.</p>
<h4>Adding PureScript to the mix</h4>
<p>Adding PureScript to your project is fairly simple, and just requires some small
changes to the project files. Firstly, still in the same directory, let’s create
new PureScript project — <code>pulp init — force</code>. (You need to use <code>— force</code> flag as
there already exists <code>.gitignore</code> file in the folder). Your directory should now
contain several additional elements:</p>
<ul>
<li><code>bower.json</code> — contains library dependency information<br /> *
<code>bower_components/</code> — a directory for installed dependencies<br /> *
<code>src/Main.purs</code> — Entry point module for your project<br /> * <code>test/Main.purs</code> —
An empty test suite.</li>
</ul>
<p>At this point, you should be able to build the project — <code>pulp build</code>, by
default the compiled JS code is put into <code>output</code> folder. But it’s not yet
plugged into our HTTP trigger. Before doing that, let’s make our PureScript code
bit more interesting.</p>
<blockquote>
<p>This section is following <a href="https://github.com/purescript/documentation/blob/master/guides/Getting-Started.md">PureScript getting started
guide</a></p>
</blockquote>
<p>The first step will be installing external PureScript library — <code>bower install
purescript-lists — save</code>. Now, open the folder in your favourite editor (VSCode)
and go the <code>src/Main.purs</code> file. Let’s replace its content with solution to the
<a href="https://projecteuler.net/problem=1">Project Euler #1</a></p>
<p>We can now build the code with <code>pulp build — skip-entry-point</code> command. Now it’s
high time to plug our PureScript code into Azure Functions. Open
<code>MyHttpTrigger/index.js</code> file and put there following code.</p>
<p>As you can see, it’s fairly straightforward. The most important thing is the
<code>require</code> call that will load compiled-to-JS PureScript code. After that, we can
call any function defined in PureScript as normal JS function.</p>
<p>At this point, you can start your function again (<code>func host start</code>) go to the
given URL and check if the answer to the Project Euler problem is correct.</p>
<h4>Deployment</h4>
<p>There exist multiple different ways of deploying Azure Function applications —
from Continues Deployment on every push to the repository, through complex build
scripts to simple uploading <code>zip</code> file. For starters, the last method is the
simplest one. You need to zip all the necessary files — <code>MyHttpTrigger</code> folder,
<code>output</code> folder, <code>host.json</code> and <code>package.json</code> files. After you have <code>zip</code> file
you can use Azure Portal, Azure CLI or simple calls to the REST API to upload
the Function.</p>
<p>To learn more about deploying Azure Functions Applications visit official
documentation —
<a href="https://docs.microsoft.com/en-us/azure/azure-functions/deployment-zip-push">https://docs.microsoft.com/en-us/azure/azure-functions/deployment-zip-push</a></p>
<h4>Summary</h4>
<p>Finishing up, in this blog post I’ve shown how easy it is to use modern,
advanced, purely functional programming language — PureScript — on the
serverless platform — Azure Functions. The example repository containing all
sample code can be found on GitHub —
<a href="https://github.com/Krzysztof-Cieslak/AzureFunctionsPureScript">https://github.com/Krzysztof-Cieslak/AzureFunctionsPureScript</a></p>
</description>
<pubDate>Sat, 12 Jan 2019 00:00:00 +0100</pubDate>
<link>http://localhost:4000/PureScript-on-Azure-Functions</link>
<guid isPermaLink="true">http://localhost:4000/PureScript-on-Azure-Functions</guid>
<category>PureScript</category>
<category>Azure</category>
<category>Serverless</category>
<category>Azure Functions</category>
</item>
<item>
<title>Future of F# cross-platform editor tooling</title>
<description><h1>Future of F# cross-platform editor tooling</h1>
<p>Currently we have this beautiful moment in the year when everyone writes,
tweets, and instagrams about their achievements in past year, and plans for the
next one. I’ve also done <a href="http://kcieslak.io/2016">this</a>
<a href="http://kcieslak.io/OSS-The-Story">before</a> (often being week…or month late),
however this year I decided to write about something else. So let’s talk about
F# cross-platform, community driven editor tooling.</p>
<!--more-->
<h3>Language Server Protocol</h3>
<p>Before diving into F# specific things, I need to mention project that has
changed how editor tooling is built over the past two years - <a href="https://microsoft.github.io/language-server-protocol/">Language Server
Protocol</a> (LSP). LSP is
specification of the communication between a client (editor) and a server that
provides language tooling capabilities such as autocomplete, tooltips, etc. It
reduces the* m-times-n* problem to the <em>m-plus-n</em> problem —similar to how
Virtual Machines solve the same problem for deploying code to many platforms
(great example here is<a href="https://en.wikipedia.org/wiki/Z-machine"> Z-machine</a>).</p>
<p><img src="https://cdn-images-1.medium.com/max/1600/1*jzJVMrcgfqUJ8YTGDpE0ZA.png" alt="" /></p>
<p>For example, instead of creating a Python VSCode plugin, a Python vim plugin, a
Python Atom plugin, and Python plugins for any other potential clients, it
allows developers to focus on single implementation of language server, this
will be automatically supported by all clients that implement LSP.</p>
<p>Of course idea of language server is not new — it’s been fairly common way to
create language tooling. In fact, the F# language already has a language service
called the <a href="https://fsharp.github.io/FSharp.Compiler.Service/">F# Compiler
Service</a>. It’s an F# API into
the internals of the F# compiler, which does all of the heavy lifting in
determining things that are useful for editor tooling. However, it is ultimately
just an F# (i.e., .NET) API and cannot be consumed in every environment without
an additional interface. An additional layer that can interface between the F#
Compiler Service and any editor (i.e., not just Visual Studio) is needed to
allow for F# tooling to be used everywhere.</p>
<h3>FsAutoComplete</h3>
<p>As I’ve mentioned — the idea of a language server is not new. And F# has been
having one for years. Initially created in 2011 (as far as I know, that was way
before I’ve joined F# community), <a href="https://github.com/fsharp/FsAutoComplete">FsAutoComplete (FSAC)
</a>has been used by all editors that
aren’t Visual Studio, such as Atom, Emacs, Vim, and VSCode. The project provides
a high level API over the F# Compiler Services, and communication layer
(standard I/O, and HTTP web server) that enables using it from non -.Net
platforms. It’s been long standing project, with many past iterations — in fact,
prior to the F# Compiler Service API being made available, it used reflection
over the F# compiler to access internal APIs! It has had many great maintainers
and contributors over the years (I especially need to mention here <a href="https://github.com/7sharp9">Dave
Thomas</a>, <a href="https://github.com/rneatherway">Robin
Neatherway,</a> <a href="https://github.com/tpetricek">Tomas
Petricek,</a> and <a href="https://github.com/enricosada">Enrico
Sada</a>) and it has been the magic that powers
<a href="http://ionide.io/">Ionide </a>since day-0.</p>
<h3>Current status</h3>
<p>When I started <a href="http://ionide.io/">Ionide </a>4 years ago, FSAC was in pretty good
shape, providing many crucial APIs and one communication layer (stdio). Over the
years, I started to contribute more and more to the project, and with help of
all awesome people involved, new contributors and community support we’ve
managed to transform FSAC into one of the best language servers I know
(especially considering it is not a commercial language service, such as those
authored by Microsoft or JetBrains), and I feel that it has been one of the most
important tools created by the .NET OSS community.</p>
<p><img src="https://cdn-images-1.medium.com/max/1600/1*g7fQGoPulhg0zk1oZQxHOw.png" alt="" /></p>
<p>Also, what is important personally for me is the level of innovation that we’ve
managed to achieve in FSAC and Ionide. Additional diagnostics such as unused
opens or unused bindings, integration with a third party linter, features
powering Ionide’s CodeLenses, background caching that enables very fast use of
any feature that requires symbols (such as Find References, CodeLens showing
number of references, etc.), and even custom <a href="https://medium.com/lambda-factory/introducing-f-analyzers-772487889429">F#
Analyzers</a>.
These are not the features that you typically see in the editor tooling created
by independent vendors, nor especially in editor tooling for FP languages (yes,
some of those features have been present in powerful IDEs for particular
languages — CodeLenses for C# in VS, or famous background caches in JetBrains
IDEs — but never for FP languages, and never provided by community driven tools)</p>
<h3>Bright Future?</h3>
<p><img src="https://cdn-images-1.medium.com/max/1600/0*8AbD6eEC3MzyHHVb" alt="" /></p>
<p>So the title of the post promised talking about the future… but the future is
now. Today, I’d like to show you the thing I’ve been working on over the Xmas
break for last 2 weeks — <a href="https://github.com/fsharp/FsAutoComplete/pull/320">the LSP communication layer for the
FSAC</a>.</p>
<blockquote>
<p>Huge thanks goes to <a href="https://github.com/vbfox">Julien Roncaglia</a> for his initial
work on LSP + FSAC proof of concept few months ago, and his F# LSP server
abstraction implementation that has been used as a base for my current work.</p>
</blockquote>
<p>Being active maintainer for editor tooling for 2
<a href="https://marketplace.visualstudio.com/items?itemName=sbrink.elm">different</a>
<a href="https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-fsharp">languages</a>,
a developer that created plugins for multiple editors, and someone that is
generally interested in editor tooling, it has become obvious for me that LSP
has won (at least in the niche of cross platform tooling provided by
community/independent vendors). There are more and more client implementations
(including really interesting online IDEs like
<a href="https://www.gitpod.io/">GitPod</a>), more and more server implementations (which
means there are more and more investments into clients) and the protocol itself
is becoming more powerful and feature-ful. I strongly believe that it is the
future of the F# cross platform tooling. From the F# point of view there is
couple of important advantages:</p>
<ul>
<li>It moves lot of code from Ionide code base to the FSAC code base — it means that
other editors than VSCode can use some of the improvements that has been
“hacked” in Ionide itself</li>
<li>It makes the contribution process easier — Ionide is a VSCode plugin written in
F# compiled to JS with <a href="https://fable.io/">Fable</a> using FSAC (totally separate
code base). This makes the process of contribution a bit awkward — if you want
to contribute you need to know which code base to work in, if it’s Ionide you
need to have the Fable toolchain set up. The idea behind using F# for Ionide was
lowering the bar for contributors (“people interested in making F# tooling
better are F# developers so the code should be F#”). As lot of Ionide code is
moved to the FSAC, it makes contributions even easier by moving a lot of code to
a normal F#/.NET Core project</li>
<li>It’s good news for anyone wanting to use Atom or Vim or Emacs (or maybe ST3?) —
some of those plugins have not been maintained very actively (or have been
deprecated like Ionide-Atom), but moving to LSP will mean that getting all new
fancy features should be way easier or “free”.</li>
<li>I’ll soon start to work on Ionide 4.0 release that will be based on LSP. Lot of
Ionide code will be removed, since Ionide provides more functionalities than
just language features — things like solution explorer, creating new projects,
right click -&gt; debug, and many features focused on developer experience are
implementations specific to VSCode (and that will probably never change).As FSAC
will take over lot of responsibilities, I hope to focus more on the UX in Ionide
itself, which is also a very interesting problem on its own.</li>
</ul>
<blockquote>
<p>As a side note — we are looking for new maintainers for FSAC. <a href="https://github.com/fsharp/FsAutoComplete/issues/321">We would love
your help</a>!</p>
</blockquote>
<h3>Grim Future?</h3>
<p><img src="https://cdn-images-1.medium.com/max/1600/1*JLKpCZqiDfA80q3O7eH38w.jpeg" alt="" /></p>
<p>Of course, every real life story have also bad parts. And there are couple of
the dark clouds on the horizon. First of all, <a href="https://github.com/ionide/ionide-vscode-fsharp/issues/948">some
</a><a href="https://github.com/ionide/ionide-vscode-fsharp/issues/938">of
</a><a href="https://github.com/ionide/ionide-vscode-fsharp/issues/914">the
</a><a href="https://twitter.com/TeaDrivenDev/status/1077622983383007233">problems
</a>with Ionide/FSAC
won’t go away with moving to LSP— they are connected to the complexity of build
and require more knowledge and time than I have (if someone from MSFT is reading
it — I would love to get, for late Xmas gift, open source, cross platform
language server for the .Net project system). But that’s just a technical
problem. The bigger one is that nothing has changed for last year and I can
repeat my words from last years’ post. While I believe that F# ecosystem is in
its best shape ever, it’s still building a castle on the sand — not enough
contributors, depending on same handful of people that overproduce, no
commercial support for OSS projects, no companies interested in investing into
F# OSS ecosystem. Ionide and FSAC are both in unsustainable state — crucial
projects for F# community, with thousands of users, that are used by a huge part
of the community every day — they get no commercial support and there are not
enough contributors to make up for this.</p>
<h3>So… 2019?</h3>
<p><img src="https://cdn-images-1.medium.com/max/1600/1*8KAxxVKVlP_CDXvAXWkrRw.jpeg" alt="" /></p>
<p>So, how will 2019 will look like? Only time will tell. But in general I believe
that there are more bright sides to the story than dark clouds. F# ecosystem is
in fairly OK place — tooling is really OK, .NET Core adoption is rising which is
a good sign, there are more and more interesting projects, community is active,
and projects like the <a href="https://safe-stack.github.io/">SAFE</a> stack are becoming
mature and are getting decent adoption.</p>
<p>However, as a community we still haven’t solved the problem of OSS
maintainability. One one hand, it’s nothing unusual — most communities struggle
with those problems. On the other hand, it’s obvious that F# commercial adoption
is very often driven by the few people building awesome OSS things, and maybe we
should help them somehow?</p>
<p>Anyway, I hope <strong>you</strong> will build great things with F# in 2019!</p>
</description>
<pubDate>Mon, 31 Dec 2018 00:00:00 +0100</pubDate>
<link>http://localhost:4000/Future-of-F-Cross-platform-editor-tooling</link>
<guid isPermaLink="true">http://localhost:4000/Future-of-F-Cross-platform-editor-tooling</guid>
<category>F#</category>
<category>VS Code</category>
<category>Tooling</category>
</item>
<item>
<title>Introducing F# Analyzers</title>
<description><h1>Introducing F# Analyzers</h1>
<p>One of the most exciting features of Roslyn (modern C# compiler) is ability to plug into it custom extensions called <a href="https://docs.microsoft.com/en-us/visualstudio/extensibility/getting-started-with-roslyn-analyzers?view=vs-2017">Roslyn Analyzers</a>. They are live, real-time, project based plugins that enables to diagnose source code and surface custom errors, warnings and code fixes into Visual Studio. What’s really important is fact that there are project based, and distributed through NuGet which means they are easy to install, and ensure that all developers working on the project have exactly same analyzers installed. This is really useful if you want to ensure common best practices, style etc while working on the project.</p>
<p>Today I’d like to introduce preview of the project called F# Analyzers which adds similar capabilities to <a href="http://ionide.io">Ionide</a> (F# support in VS Code). Project is still in the early days, so design and technical details can change in time, but I’m really excited to share it with users even in its current state.</p>
<!--more-->
<h3>Architecture overview</h3>
<p>Before diving deeper into Analyzers themselves, it’s important to understand general architecture of Ionide, and where Analyzers fits into this architecture. This has really important impact on the Analyzers capabilities and limitations.</p>
<p>On the one hand we have Ionide itself. It’s <a href="https://code.visualstudio.com/docs/extensions/overview">VS Code plugin</a> which means it’s using NodeJS runtime, running as a child process of the editor, communicating with VS Code using set of APIs provided by VS Code. On the other hand we have F# compiler, or exactly speaking <a href="https://fsharp.github.io/FSharp.Compiler.Service/index.html">FSharp.Compiler.Service</a> which is library version of F# compiler, exposing some additional APIs useful for creating tooling for F#. Of course, <code>FSharp.Compiler.Service</code> is .Net library which means it can’t be used directly by NodeJS process.</p>
<p>Last important part of the architecture is <a href="https://github.com/fsharp/FsAutoComplete">FsAutoComplete</a>. It’s a project that provides communication layer and high level API between FCS and external world. It’s used by vim, emacs and Ionide as all those plugins are hosted in non .Net environments.</p>
<p>The F# Analyzers are using extension point provided by the FsAutoComplete which means that in current shape they can be supported only by the editors using it (and they requires some work on the plugin side of things - currently only Ionide supports them). And it means that diagnostics provided by them are visible only in the editor, not during compilation.</p>
<h3>Analyzers basics</h3>
<p>Analyzer is normal F# function. As an input it takes Context object which contains current information about the file - Parse Tree, Type Abstract Syntax Tree, Symbols information, and returns list of the Diagnostics - records containing diagnostic message, type, description, and potentially list of fixes that can be used to fix the problem.</p>
<p>F# Analyzer contains 3 parts - first one is an extension point in FSAC which is responsible for loading and running analyzers, second one is a editor handler (part of Ionide, in this case) that displays diagnostics and fixes. Last part is <a href="https://github.com/Krzysztof-Cieslak/FSharp.Analyzers.SDK">FSharp.Analayzers.SDK</a> project that’s used to create analyzers.</p>
<h3>Building your first analyzer</h3>
<p>From infrastructure point of view, creating analyzer is simple - you need to create normal F# project, <code>netstandard2.0</code> , add reference to <code>FSharp.Analyzers.SDK</code> (avaliable on NuGet - <a href="https://www.nuget.org/packages/FSharp.Analyzers.SDK/">https://www.nuget.org/packages/FSharp.Analyzers.SDK</a>) and create analyzer functions - normal F# functions taking Context returning list of diagnostics, and marked with Analyzer attribute.</p>
<blockquote>
<p>Due to unresolved technical limitations your Analyzer must contain “Analyzer” in the name of output dll.</p>
</blockquote>
<p>However, from technical point of view creating analyzer is fairly difficult task - you need to be familiar with processing typed or untyped abstract syntax tree, or accessing FSharp Symbols information. Currently SDK doesn’t provide any helper functions, but we hope to add some higher level abstractions in the future. Currently, I recommend going through <a href="http://fsharp.github.io/FSharp.Compiler.Service/">FCS documentation</a>, to get more familiar with the concepts</p>
<p>Generally speaking processing Abstract Syntax Trees is usually done by recursive pattern matching on the DU representing syntax nodes. The following snippet shows how to travers Type Abstract Syntax Tree and call some function on every node that represents call of the member. While it looks bit scary, and complex if you take a look on it bit longer you will notice that it’s just big recursive pattern matching. Also, similar pattern matching will be base for most analyzers, which means you can reuse the code pretty easily.</p>
<script src="https://gist.github.com/Krzysztof-Cieslak/34c2a43c52119fde8d55315c7831244d.js"></script>
<p>Having this bit of infrastructure code, let’s now move to the analyzer itself. As I’ve mentioned before, analyzers are normal functions that have particular signature and are marked with attribute.</p>
<script src="https://gist.github.com/Krzysztof-Cieslak/42829ce7b5dcc937bece698a5af9ff2b.js"></script>
<p>In the above snippet we create analyzer that will detect any call of <code>x.Value</code> where x is an F# Option. As you probably know calling <code>.Value</code> on an <code>option</code> is not total function and can throw exception if an <code>option</code> instance is <code>None</code>, so checking for it may be good idea.</p>
<p>The handler function in above example is executed for every member call. In it we check if the name of the function we call, and if it’s <code>Option.Value</code> we add the range of the symbol into the state. After we’ve processed whole tree we map all ranges into the warnings that will be displayed in the editor. There also exist possibility of providing set of code fixes, but we don’t use it in this example.</p>
<blockquote>
<p>Whole code of the sample analyzer is available on GitHub - <a href="https://github.com/Krzysztof-Cieslak/FSharp.Analyzers.Sample">https://github.com/Krzysztof-Cieslak/FSharp.Analyzers.Sample</a>, and analyzer is published on NuGet - <a href="https://www.nuget.org/packages/FSharp.Analyzers.Sample/">https://www.nuget.org/packages/FSharp.Analyzers.Sample/</a></p>
</blockquote>
<h3>Using analyzer</h3>
<p>Analyzers are enabled by <code>FSharp.enableAnalyzers</code> setting inside VSCode. By default it’s disabled, so you need to edit settings to enable analyzers support. Using analyzers is as simple as adding Analyzer NuGet package with Paket - for out of the box support in Iondie you need to use Analyzer group for it.</p>
<script src="https://gist.github.com/Krzysztof-Cieslak/dc71359d81354129187584c502cc60e6.js"></script>
<p>After the package is added to <code>paket.dependencies</code> and restored, Ionide will automatically detect and load analyzers. It may require editor restart as analyzers are loaded on plugin startup.</p>
<blockquote>
<p>Ionide also contains setting <code>FSharp.analyzersPath</code> that will enable you to configure paths from which Ionide loads analyzers, by default it’s using <code>packages/Analyzers</code> and <code>analyzers</code> folders.</p>
</blockquote>
<p>For example let’s test our new analyzer on the following snippet.</p>
<script src="https://gist.github.com/Krzysztof-Cieslak/c1962db70231ec9d2581955324f6ac82.js"></script>
<p>This will result in underlying <code>x.Value</code> with a warning saying that Option.Value shouldn’t be used</p>
<p><img src="https://cdn-images-1.medium.com/max/2000/1*axoWiRB3EPANiOljA_PWzg.png" alt="" /></p>
<blockquote>
<p>Sample project using analyzer can be found on GitHub - <a href="https://github.com/Krzysztof-Cieslak/FSharp.Analyzers.Sample.Usage">https://github.com/Krzysztof-Cieslak/FSharp.Analyzers.Sample.Usage</a></p>
</blockquote>
<h3>So what’s next?</h3>
<p>Currently there are several important limitation of the F# Analyzers. First of all they’re supported only by Ionide. Secondly to write analyzer you need to be familiar with F# (T)AST pretty well. And in the end writing fixes requires providing new version of code in textual form (unlike in case of Roslyn Analyzers where fixes can be provided as AST transformation), what may be difficult and error prone. Also, whole mechanism is currently in an experimental phase, relies on Reflection etc. so it can be bit unstable.</p>
<p>However, I treat this as an experiment and proof of concept, that may be used as a base for discussing similar functionalities being added to F# compiler or other IDEs. Also I’m super excited to see what potentially great things can F# Community create having such extension point in the editor (Evil Hint: You can use this feature to run any code inside of the language server and return some information to editor… which sounds awesome and crazy at the same time)</p>
<h3>Summary</h3>
<p>In this post I’ve introduced preview of new tooling related project that enables users to add custom analyzers to your editor, bringing functionality similar to Roslyn Analyzers. While this is only experiment, and proof-of-concept I’m looking forward to seeing all innovative things it can enable. Analyzers support has been released in new Ionide version - <code>3.27.0</code> - so it’s out there and ready for experimenting!</p>
</description>
<pubDate>Fri, 14 Sep 2018 00:00:00 +0200</pubDate>
<link>http://localhost:4000/Introducing-F-Analyzers</link>
<guid isPermaLink="true">http://localhost:4000/Introducing-F-Analyzers</guid>
<category>F#</category>
<category>VS Code</category>
<category>Tooling</category>
</item>
<item>
<title>Building an MVP with F# and Saturn</title>
<description><h1>Building an MVP with F# and Saturn</h1>
<p>Creating an MVP (minimum viable product) is one of the best way of bootstrapping your startup. As a new company getting a quick feedback from the application users, bringing an application to users as fast as possible, being able to adapt as quickly as possible to the market changes, and providing frequent application updates is crucial for the initial success of the product. But it’s also important to understand that an MVP software development is not synonymous with unfinished or a primitive product that was created in a hurry.</p>
<!--more-->
<h3>What is an MVP?</h3>
<p>Minimum Viable Product (MVP) is the smallest, most concise version of your product you can initially release for feedback. It enables a full turn of the feedback loop with the least amount of development time and effort. This allows the targeted users to try a product and evaluate it to make the complete version better. It is a frequently updated environment with the new features that could be seen and tested by clients. New registration page, an admin management panel, as well as email notifications, and any other new features you can imagine.</p>
<p>MVP development allows early adopters to understand the vision or promise of the final product and provide valuable feedback to guide developers moving forward. The main advantages of the MVP software development are:</p>
<ul>
<li>
<p>MVP has enough value that people can already use or buy it</p>
</li>
<li>
<p>It demonstrates enough features to hook and retain early users</p>
</li>
<li>
<p>It provides feedback loop to guide future development</p>
</li>
<li>
<p>It shows enough future potential to start marketing around the project</p>
</li>
</ul>
<p>What’s important - MVP development is not only the strategy for startups. When you already have well-established company and customers, you also need to have some way to experiment with new potential products or features. In a lot of cases, the minimum viable product really is just a way to do that.</p>
<h3>Few words about F#</h3>
<p><a href="https://fsharp.org">F# is a functional-first programming language</a> running on the .Net platform. Paired with <a href="https://www.microsoft.com/net">.Net Core</a> - modern, cross platform implementation of the .Net Framework - it is fantastic tool for writing modern applications. .Net Core provides industrial level of the performance, security, huge ecosystem of the libraries, and always growing open source community. F#, itself an open source language with fantastic community , thanks to expressiveness, functional-first approach, great developers tooling and advanced language features provides unmatched developer experience and fast development speed, so important for building MVPs. It can also be your secret weapon that makes you stand out from many different companies, and that let you hire more talented people that just want to work with more niche technology.</p>
<h3>Introducing Saturn</h3>
<p>F# due to its functional nature is perfect fit for the web applications. In the end HTTP web server may be treated as a function that takes Request and returns Response.</p>
<p><a href="https://saturnframework.org">Saturn</a> is a modern web framework for the F# focusing on high level abstractions and great developer experience, allowing developers focus on the things that matters for your business. Influenced by the popular frameworks such as Rails or Phoenix it comes with all the batteries included. Its ecosystem includes development tools that allows developers to quickly create new applications, add new features to existing applications, and test new features; it integrates with existing <a href="https://docs.microsoft.com/en-us/aspnet/core/?view=aspnetcore-2.1">ASP.NET Core</a> ecosystem that provides huge set of existing modules that you can use in your application; it provides pre-defined configurations that limits the number of decisions that developers need to make. And all this while using highly expressive and modern programming language.</p>
<h3>Typical difficulties</h3>
<p>While MVP development is really powerful technique, just like every other methodology it has its own drawbacks. First of all you need to understand it’s not about delivering product as fast as possible so customers can try it out. MVP development is about refined and validated learning. This simple fact must be understood by everyone - stakeholders, developers, customers. You have to understand that final product may drastically change due to user’s feedback. And this is something that must be embraced by the development team, and should impact the way in which they work. Developers needs to have regular feedback session, learn from them, prioritise features.</p>
<p>As a result, this should have an impact on the technologies chosen for developing MVP:</p>
<ul>
<li>
<p>refactoring plays the key roles, when you see that some part of the product is not scalable or flexible enough, or that it just need changes based on the user’s feedback you need to be able to quickly change an existing code base</p>
</li>
<li>
<p>correctness is important, especially the one you can get for free. Using static type checking, code linting, and code quality tools is crucial to provide product that’s working well enough, without spending much development time on it</p>
</li>
<li>
<p>flexible but simple design - design of your product must be flexible enough to provide ability to change the product based on the feedback, but at the same time it must be relatively simple - for MVP development you want to get to the market as fast as possible, and you don’t want to spend time building sophisticated architecture that may not work after all changes that will happen in the future</p>
</li>
</ul>
<p>Fortunately, F# and .Net Core are great solutions for all those problems - functional first approach naturally pushes you toward pit of success, and simple, flexible architecture, static typing with powerful type inference enables you to create correct software without much overhead, best in class editor tooling helps you to quickly refactor existing code.</p>
<h3>Commercial support</h3>
<p>The last important factor in choosing right technology is having an ability to hire someone to develop the product, or just get help. F# ecosystem is including wide range of the options for getting commercial support - starting from the established companies providing support for <a href="https://safe-stack.github.io">SAFE Stack</a> through multiple independent consultants to <a href="https://lambdafactory.io">Lambda Factory</a>. Lambda Factory specialises in creating web applications, F# training and consulting, MVP development, and developer relationships. We provide everything you need to transform your startup into prospecting business - help with creating MVP, iterating over the feedback loop, hiring talented developers, and DevRel marketing.</p>
</description>
<pubDate>Thu, 16 Aug 2018 00:00:00 +0200</pubDate>
<link>http://localhost:4000/Building-an-MVP-with-F-and-Saturn</link>
<guid isPermaLink="true">http://localhost:4000/Building-an-MVP-with-F-and-Saturn</guid>
<category>F#</category>
<category>Saturn</category>
<category>Web</category>
<category>MVP</category>
</item>
<item>
<title>Challenges of post-OSS world</title>
<description><h1>Challenges of post-OSS world</h1>
<p>Open Source Software has won. After years of convincing people to use open source software, fighting with false dichotomy between OSS and industrial, commercial software, and defending against negative biases, position of OSS is no longer disputed - it’s been used by vast majority of companies around the world, it has become default choice when choosing technologies, it powers the internet, our PCs, mobile phones and most devices we use every day, it’s been accepted by huge, conservative companies that were against whole concept few years ago.</p>
<p>But have we really been ready for that? For most of its history OSS community was busy fighting for survival. And we created strategy, methodologies, and public relations attitudes that were helping us fight for this survival. But the times have changed and now we face totally different set of problems that we need to solve.</p>
<!--more-->
<h3>Outdated foundations</h3>
<blockquote>
<p>93% - percentage of npm packages with just one maintainer</p>
</blockquote>
<p>General understanding of the mechanism ruling the OSS ecosystem is relatively outdated. As mentioned above - our knowledge about foundation of community based software was shaped when OSS was treated as something bad and undesirable by mainstream programming industry. Organisations like Free Software Foundation, licenses like GPL have their roots in 80s and 90s. The amazing essay *“The Cathedral and the Bazaar” *that has shaped how we understand the community based software was published in 1999. Those were totally different times - when the software market was dominated by companies like IBM, Oracle and Microsoft that were clearly against any ideas of free software. And back then we need different ways of speaking about OSS - the Bazaar analogy was designed to win hearts of the developers, to show that they don’t need to be afraid of the open source software. And it has done that really, really well. However it shouldn’t be used in 2018 as a way of describing how OSS works - we now face different set of issues.</p>
<p>While many of the ideas from *The Cathedral and the Bazaar” *have aged really well, and still apply to any kind of software development, OSS nowadays is not about creating huge communities, applying “given enough eyeballs, all bugs are shallow” law, or in principle following Bazaar model. On the contrary, given all the success that OSS has achieved the Bazaar model has been unsuccessful - only 3% of popular OSS projects are using such development model. Of course those 3% contains some hugely popular and impactful projects - such as Rails or Linux - but one could argue that they’re using this model as a result of their success and not other way round. In the end, no project starts as a community, there is always someone in charge, and communities around the projects are created only after they are successful.</p>
<h3>Unlimited growth</h3>
<blockquote>
<p>28 millions of developers - number of registered users at GitHub.com</p>
</blockquote>
<p>No-one in the 90s could predict the scale of the success that OSS will achieve. The number of developers doing OSS, number of projects, and number of users has raised by several orders of magnitude over last 20 years. The Bazaar model was created when huge percentage of the people using OSS were people developing OSS. But current state of the world is bit different. Let’s just compare some numbers.</p>
<p>The number of downloads per 2 weeks:</p>
<ul>
<li>
<p>1998 - 180K downloads of Netscape (most popular OSS project at the time)</p>
</li>
<li>
<p>2017 - 21M downloads of Loadash (random JS library)</p>
</li>
</ul>
<p>The number of registered users:</p>
<ul>
<li>
<p>2001 - 208K on SourceForge</p>
</li>
<li>
<p>2018 - 28M on GitHub</p>
</li>
</ul>
<p>The number of active projects:</p>
<ul>
<li>
<p>2008 - 150K on SourceForge</p>
</li>
<li>
<p>2017 - 29M on GitHub</p>
</li>
</ul>
<p>As we can see, OSS nowadays is massive, global and popular. But there are main 2 issues here. First one is yet increasing fragmentation of the ecosystem - unlike what was presented as big advantage of the Bazaar model, modern OSS is not about creating those singular points of focus for the communities. We don’t get “enough eyeballs”, instead we all rely on the projects that are very often driven forward by single maintainer and one or two other contributors. Second one is that growth of the user-base doesn’t resulted in proportional growth of contributors of the projects. And what’s even more important the growth of the contributors hasn’t resulted in the proportional growth of the maintainers - which results in more and more pressure put on the focal parts of our communities which itself is really huge issue.</p>
<h3>Maintainers struggle</h3>
<blockquote>
<p>“The more successful you are, the more you get punished with GitHub notifications.” - <a href="https://nolanlawson.com/2017/03/05/what-it-feels-like-to-be-an-open-source-maintainer/">What it feels like to be an open-source maintainer</a></p>
</blockquote>
<p>Maintainers are the focal points of the community of any OSS project. Not only they’re often main developers behind the project but also they have many other responsibilities - they need to keep users happy, they need to handle contributors to create good workflow that will enable new code contributions, they need to help first time contributors, they need to review PRs, handle releases, and keep general direction of the project.</p>
<blockquote>
<p>“Current status - anxious and depressed whenever I open my GitHub notifications. Programming is so much fun”</p>
</blockquote>
<p>However we don’t really get new maintainers too often. The number of users growth really fast, the number of developers grows - and while those 2 things are great, they create huge pressure on the maintainers. And the Bazaar analogy is part of the problem here - we expect someone to always step up, we expect contributors to become more and more involved. But the reality is bit different - 1/2 contributors contributes only once, and they account for around 2% of the commits. And every contribution is additional work for the maintainer, additional PR to review, and additional code to maintain later. Of course, every contribution is valuable, and welcomed but in general OSS community has huge “second time contribution” problem - we put lot of emphasis and work to optimise first contribution experience - but it unfortunately is not resulting in many long standing members of the community.</p>
<h3>Sustainability</h3>
<blockquote>
<p>$143,000,000 - Estimated value of open source software in $1B Instagram acquisition</p>
</blockquote>
<p>OSS movement was shaped in the times were most mainstream software was proprietary, it was not vastly used, and no business depended on it. But nowadays, OSS is everywhere - it powers internet, operating systems, software and products we use everyday. It’s hard to imagine building new software without using any OSS technologies and OSS is used by the biggest, most conservative (In terms of technological choices) companies of the world - 100% of Fortune 500 companies are using npm.</p>
<p>And yet, even some most popular OSS projects ever struggle to get any founding, and build any notion of sustainability. But we continue to build businesses using those tools and libraries. One would hope that in the future we will start to think about open source software in terms of digital infrastructure - that, just like our normal infrastructure, requires constant funding to function properly.</p>
<h3>How we talk about OSS</h3>
<blockquote>
<p>“Just like physical infrastructure, digital infrastructure needs regular upkeep and maintenance.” - <a href="https://www.fordfoundation.org/about/library/reports-and-studies/roads-and-bridges-the-unseen-labor-behind-our-digital-infrastructure/">Roads and Bridges: The Unseen Labor Behind Our Digital Infrastructure</a></p>
</blockquote>
<p>Probably to solve some of those problems we need to change a way we talk about OSS - instead of convincing our managers that we need to contribute because it is “good” behavior, or because it will improve “morale” of the team we should talk in business terms - risk and opportunity. Contributing to the projects decrease our risk as a business - it decrease risk that project maintainer will rage quit and we will be stuck with unmaintained project, it decrease risk of needing help of other people if we have some problems with the project. Contributing to the project is also opportunity - we can shape project, add new features that will enable us to make our business solutions better.</p>
<p>And the other interesting value proposition for contributing to OSS is just plain marketing value - especially if your product targets technical communities. We know live in the times of Developers Relationships movement, were any company building software projects for developers spends lot of resources for promotion. Contributing to OSS is great way of such promotion. And even if your business is not building tools for developers - it will make hiring talented developers way easier.</p>
<h3>Solutions? I have none</h3>
<p>I don’t know how to solve the problems of the current OSS world. But it is pretty clear that OSS needs evolve - we need new definitions, new solutions and new leaders for the movement that already changed the world. OSS nowadays struggle with totally different set of the problems than it did 20 years ago, so using the analogies that were used 20 years ago, may not be the way forward. And I do believe that we need to find those solutions pretty fast… or it will turn out that we’ve built our great castle on the sand.</p>
<blockquote>
<p>This blog post is adaptation of my “Challenges of post-OSS world” talk I’ve presented on couple of events. If you’d like to have me talk about OSS on your conference and your company feel free to reach me at [email protected]</p>
</blockquote>
<blockquote>
<p>Both talk and this blog post has been deeply influenced by the work of <a href="https://nadiaeghbal.com/">Nadia Eghbal</a>.</p>
</blockquote>
</description>
<pubDate>Sat, 11 Aug 2018 00:00:00 +0200</pubDate>
<link>http://localhost:4000/Challenges-of-post-OSS-world</link>
<guid isPermaLink="true">http://localhost:4000/Challenges-of-post-OSS-world</guid>
<category>Open Source</category>
<category>Community</category>
</item>
<item>
<title>Using OAuth with Saturn</title>
<description><h1>Using OAuth with Saturn</h1>
<p><a href="https://saturnframework.org">Saturn</a> is new F# web framework that provides flexible, high level model of creating web applications using principles of functional programming and MVC architectural pattern. Main design goals of Saturn includes high level abstractions that lets developers focus on creating business code , and general developer experience. One of the features provided by Saturn is support for popular way of authentication - OAuth</p>
<blockquote>
<p>This blog post was created for Saturn version 0.7.5</p>