Learning F# by Designing Your Own Language, by Alexey Golub
Today we are not announcing another online meetup but something better. On June 5th we will bring back F# Conf! A full day #fsharp online conference – totally free and packed with awesome speakers. Stay tuned for more infos and first speaker announcements.https://t.co/fPgTLzHTom
— F# "FSharp Conf on the 5th of June" Online (@fsharponline) April 28, 2020
Since .NET 5 preview 3, by setting DOTNET_NEW_PREFERRED_LANG=F# env var, all the new projects of .NET CLI will be in #fsharp by default! Yay! pic.twitter.com/SnzWNTOad6
I've released new versions of the `dotnet new` Saturn template and Saturn CLI tool – everything got updated to .Net Core 3.1, and .Net local tools (including Saturn.Cli)#fsharp
Pulumi .NET is now fully supported! Even in preview, we had thousands of users, ~100k downloads on NuGet, and ~1 mln. lines of code across ~35 providers. Get started đhttps://t.co/aA14EchucT
#Squirrel – my CLR language building language – compiler as a service , REPL support and CTFE for any language. Programmable type systems as macros. Build .NET languages with any syntax and have @racketlang macros for free. a 'lil script language I've been tinkering with: pic.twitter.com/mFLl2wymAM
Thanks @dustinmoris for latest Giraffe release. This massively reduces the complexity of the dependency chain for @dotnet core @aspnet#fsharp web projects. Once TaskBuilder 2.2 is released this will bring further improvements. @PaketManager lock file goes from 200+ to 50 lines. pic.twitter.com/bs8Kegons1
đ Rider 2020.1 is here! đ„ł đ„ The backend runs on .NET Core on macOS and Linux đ„ Xamarin Hot Reload đ„ Better performance in Unity support đ„ Dataflow analysis for integer values đ„ Dynamic Program Analysis đ„ and more!https://t.co/O1bkKKR1tqpic.twitter.com/Ac6PbEpsiD
Eventually managed to write an initial blog post about Mobius – .NET runtime running on .NET Core. Inception? A rationale behind it and a very high-level design overview. Read at https://t.co/LpiW0lzI5Xpic.twitter.com/qxGddIGRO6
Weâre sorry to inform you that we decided to postpone the F# Europe 2020 conference, due to COVID-19. We are still very excited about our first edition and we hope to see you in 2021! [1/2]
If you'd like string interpolation in F#, please have a play with the rough prototype implementation of RFC-0001 I completed today, based on a community contributed starting point. Read the RFC for design.https://t.co/eS6Ty7hl1v
F# world – I remember someone wrote F# computation expression builders "list { .. }" and "array { .. }" for generating lists/arrays via a mutable ResizeArray (rather than an underlying sequence expression for "[ .. ]"), and got good perf gains.
World |> Hello. This is the official #fsharp Online twitter account. Follow me to get the newest infos about our call for speakers and our next meetups.
Hey #fsharp people! The F#Â editor in VSMac has been completely replaced with a port of the editor from Windows. If you'd like to get a super early peek of what will land in VSMac 8.7 please give this a shot! https://t.co/ZPpth7SjBB
Today I am happy and excited to announce that I am finally publishing my largest body of work into the OSS world. Introducing The Elmish Book: A practical guide to building reliable web applications with #fsharp and @FableCompiler from first principles https://t.co/fFkoKSOi2F đ
Hi F# users, I recently started to use dependabot for watching my dependencies. It works really great for js packages. But currently it only watches nuget references in fsproj files. Someone interested in adding a Paket lock file crawler?https://t.co/ISYYIkNu1a#paket#fsharp
Clippit is .NETStandard 2.0 library that allows you to easily and efficiently extract all slides from PPTX presentation into one-slide presentations or compose slides back together into one presentation.
Why?
PowerPoint is still the most popular way to present information. Sales and marketing people regularly produce new presentations. But when they work on new presentation they often reuse slides from previous ones. Here is the gap: when you compose presentation you need slides that can be reused, but result of your work is the presentation and you are not generally interested in “slide management”.
One of my projects is enterprise search solution, that help people find Office documents across different enterprise storage systems. One of cool features is that we let our users find particular relevant slide from presentation rather than huge pptx with something relevant on slide 57.
How it was done before
Back in the day, Microsoft PowerPoint allowed us to “Publish slides” (save each individual slide into separate file). I am absolutely sure that this button was in PowerPoint 2013 and as far as I know was removed from PowerPoint 365 and 2019 versions.
When this feature was in the box, you could use Microsoft.Office.Interop.PowerPoint.dll to start instance of PowerPoint and communicate with it using COM Interop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
But server-side Automation of Office has never been recommended by Microsoft. You were never able to reliably scale your automation, like start multiple instances to work with different document (because you need to think about active window and any on them may stop responding to your command). There is no guarantee that File->Open command will return control to you program, because for example if file is password-protected Office will show popup and ask for password and so on.
That was hard, but doable. PowerPoint guarantees that published slides will be valid PowerPoint documents that user will be able to open and preview. So it is worth playing the ceremony of single-thread automation with retries, timeouts and process kills (when you do not receive control back).
Over the time it became clear that it is the dead end. We need to keep the old version of PowerPoint on some VM and never touch it or find a better way to do it.
The History
Windows only solution that requires MS Office installed on the machine and COM interop is not something that you expect from modern .NET solution.
Ideally it should be .NETStandard library on NuGet that platform-agnostic and able to solve you task anywhere and as fast as possible. But there was nothing on Nuget few months ago.
If you ever work with Office documents from C# you know that there is an OpenXml library that opens office document, deserialize it internals to an object model, let you modify it and then save it back. But OpenXml API is low-level and you need to know a lot about OpenXml internals to be able to extract slides with images, embedding, layouts, masters and cross-references into new presentation correctly.
If you google more you will find that there is a project “Open-Xml-PowerTools” developed by Microsoft since 2015 that have never been officially released on NuGet. Currently this project is archived by OfficeDev team and most actively maintained fork belongs to EricWhiteDev (No NuGet.org feed at this time).
Open-Xml-PowerTools has a feature called PresentationBuilder that was created for similar purpose – compose slide ranges from multiple presentations into one presentation. After playing with this library, I realized that it does a great job but does not fully satisfy my requirements:
Resource usage are not efficient, same streams are opened multiple times and not always properly disposed.
Library is much slower than it could be with proper resource management and less GC pressure.
It generates slides with total size much larger than original presentation, because it copies all layouts when only one is needed.
It does not properly name image parts inside slide, corrupt file extensions and does not support SVG.
It was a great starting point, but I realized that I can improve it. Not only fix all mentioned issues and improve performance 6x times but also add support for new image types, properly extract slide titles and convert then into presentation titles, propagate modification date and erase metadata that does not belong to slide.
How it is done today
So today, I am ready to present the new library Clippit that is technically a fork of most recent version of EricWhiteDev/Open-Xml-PowerTools that is extended and improved for one particular use case: extracting slides from presentation and composing them back efficiently.
All classes were moved to Clippit namespace, so you can load it side-by-side with any version of Open-Xml-PowerTools if you already use it.
The library is already available on NuGet, it is written using C# 8.0 (nullable reference types), compiled for .NET Standard 2.0, tested with .NET Core 3.1. It works perfectly on macOS/Linux and battle-tested on hundreds of real world PowerPoint presentations.
New API is quite simple and easy to use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Say hello to Rider â.NET Core editionâ! The backend now can be run on the .NET Core runtime instead of Mono on macOS and Linux! Enable it in "Help | Switch IDE runtime to .NET Core". Enjoy the performance boost and a lower memory footprint! https://t.co/Fbusabm8SPpic.twitter.com/1ZcicEsum4