{"id":390,"date":"2023-06-28T12:04:28","date_gmt":"2023-06-28T11:04:28","guid":{"rendered":"https:\/\/informedica.nl\/?p=390"},"modified":"2023-06-28T12:06:18","modified_gmt":"2023-06-28T11:06:18","slug":"f-compilation-speed","status":"publish","type":"post","link":"https:\/\/informedica.nl\/?p=390","title":{"rendered":"F# Compilation Speed"},"content":{"rendered":"\n<p>Just recently, I was watching the <a rel=\"noreferrer noopener\" href=\"http:\/\/fsharpconf.com\/\" target=\"_blank\">fsharpConf2023<\/a>. There was a very interesting talk from the CEO of <a rel=\"noreferrer noopener\" href=\"https:\/\/darklang.com\/\" target=\"_blank\">Darklang<\/a>, Paul Biggar. Darklang was originally created using OCaml. Later on they decided to switch to F# and the talk is about their experience with F#. Paul Biggar specifically discussed the goods and the bads of F# as a language to use in production. One of the comments that stood out to me was the compilation speed of F#.<\/p>\n\n\n<p><!--more--><\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"508\" src=\"https:\/\/informedica.nl\/wp-content\/uploads\/2023\/06\/image-1-1024x508.png\" alt=\"\" class=\"wp-image-392\" srcset=\"https:\/\/informedica.nl\/wp-content\/uploads\/2023\/06\/image-1-1024x508.png 1024w, https:\/\/informedica.nl\/wp-content\/uploads\/2023\/06\/image-1-300x149.png 300w, https:\/\/informedica.nl\/wp-content\/uploads\/2023\/06\/image-1-768x381.png 768w, https:\/\/informedica.nl\/wp-content\/uploads\/2023\/06\/image-1-1536x762.png 1536w, https:\/\/informedica.nl\/wp-content\/uploads\/2023\/06\/image-1.png 1724w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Darklang comparison of OCaml with F#<\/figcaption><\/figure>\n\n\n\n<p>The dislike of the compilation speed got my attention as I never experienced problems with compilation speed. And why was that? It could be I only have been working on small projects. But the project I am currently working on has a compilation time of 16 secs, and that is not really fast. Why then is it that I never experienced this as a real problem? <\/p>\n\n\n\n<p>Well, I obviously do not run a lot of compilation on my code while developing. What I typically do is that I just take all the code I need for development and either reference or load them to a script file and use that as a starting point to enhance\/change or add to my code. I even will copy over all the code for a specific project, paste that in a single script file and start working on that. To me that is an incredible powerful way of working with F#, as it feels that I can directly communicate with my code.<\/p>\n\n\n\n<p>I also often see youtube videos on F# that show you code in a regular &#8220;fs&#8221; code file that has to be run through compilation. I think that is not the best way of teaching or even using F#. You can do essentially all your coding in a F# script file and then later on move the working code to individual code files in your project. The one exception that I know of is the code you write for a fable project, but then again, there is no compilation, but a translation to javascript.<\/p>\n\n\n\n<p>As an example is a rather large script file dealing with trees:<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/halcwb\/ec64ae3a4e1c2e1257096e5d5766e559.js\"><\/script>\n\n\n\n<p>So, it seems to me that the slow compilation speed of F# might not be such a big issue when you can avoid compilation until you really want to move your code or adaptations of existing code to production. I wonder whether that would also be the case for the Darklang people.<\/p>\n<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_390\" class=\"pvc_stats all  \" data-element-id=\"390\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/informedica.nl\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Just recently, I was watching the fsharpConf2023. There was a very interesting talk from the CEO of Darklang, Paul Biggar. Darklang was originally created using OCaml. Later on they decided to switch to F# and the talk is about their experience with F#. Paul Biggar specifically discussed the goods and the bads of F# as &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/informedica.nl\/?p=390\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;F# Compilation Speed&#8221;<\/span><\/a><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_390\" class=\"pvc_stats all  \" data-element-id=\"390\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/informedica.nl\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-390","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/informedica.nl\/index.php?rest_route=\/wp\/v2\/posts\/390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/informedica.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/informedica.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/informedica.nl\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/informedica.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=390"}],"version-history":[{"count":2,"href":"https:\/\/informedica.nl\/index.php?rest_route=\/wp\/v2\/posts\/390\/revisions"}],"predecessor-version":[{"id":395,"href":"https:\/\/informedica.nl\/index.php?rest_route=\/wp\/v2\/posts\/390\/revisions\/395"}],"wp:attachment":[{"href":"https:\/\/informedica.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/informedica.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/informedica.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}