Giter Site home page Giter Site logo

fstarmsbuildsdk's Introduction

F* SDK

This is MSBuild SDK for F*.

Use templates

dotnet new --install FStarLang.DotNet.Common.ProjectTemplates.1.0::0.1.0 --nuget-source https://codevision.pkgs.visualstudio.com/FStarLang/_packaging/fstarlang/nuget/v3/index.json

Then you can create project using

dotnet new fstarconsole -o helloworld

Manually convert F# project

Create new Nuget.config using dotnet new nugetconfig

Paste in that file following configuration file.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <!--To inherit the global NuGet package sources remove the <clear/> line below -->
    <clear />
    <add key="fstar-experimental" value="https://codevision.pkgs.visualstudio.com/FStarLang/_packaging/fstarlang/nuget/v3/index.json" />
    <add key="nuget" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>

Create new F# project and replace it with following content.

<Project Sdk="FStarLang.Sdk/0.0.2">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Program.fst" />
  </ItemGroup>
</Project>

Also rename Program.fs to Program.fst and now you can run your code using dotnet run. That's it folks!

Development

For creation of new version of SDK

  • bump version in the src\sdk\FStarLang.Sdk.csproj
  • run
dotnet build -c Release src/sdk/FStarLang.Sdk.csproj
  • publish Nuget file located at src\sdk\bin\Release
dotnet nuget push --source fstarlang --api-key az src/sdk/bin/Release/FStarLang.Sdk.0.0.5.nupkg
  • Go back to root of the project
  • bump version in the src/runtime/FStarLang.Runtime.csproj
  • Change FStarCompilerVersion to latest F* compiler release in the src/runtime/FStarLang.Runtime.csproj
  • run
dotnet build -r win-x64 -c Release src/runtime/FStarLang.Runtime.csproj
dotnet build -r linux-x64 -c Release src/runtime/FStarLang.Runtime.csproj
  • publish Nuget file located at src\sdk\bin\Release
dotnet nuget push --source fstarlang --api-key az --interactive src/runtime/bin/Release/runtime.win-x64.FStarLang.Compiler.0.0.3.nupkg
dotnet nuget push --source fstarlang --api-key az --interactive src/runtime/bin/Release/runtime.linux-x64.FStarLang.Compiler.0.0.3.nupkg
  • Go back to root of the project
  • bump version in the src/templates/FStarLang.DotNet.Common.ProjectTemplates.1.0.csproj
  • run
dotnet pack -c Release src/templates/FStarLang.DotNet.Common.ProjectTemplates.1.0.csproj
  • publish Nuget file located at src\sdk\bin\Release
dotnet nuget push --source fstarlang --api-key az --interactive src/templates/bin/Release/FStarLang.DotNet.Common.ProjectTemplates.1.0.0.0.5

fstarmsbuildsdk's People

Contributors

kant2002 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fstarmsbuildsdk's Issues

Interop with F#

I would like to write FStar functions and then call them from F#.

What would be a recommended setup for this?
I suppose the creation of one FStar project using FStarMSBuildSDK, and one (or more) F# projects where FStar project would be referenced from.

Can you recommend some best practices on this, please? Thanx!

Template cannot be installed

Running

dotnet new install FStarLang.DotNet.Common.ProjectTemplates.1.0::0.1.0 --nuget-source https://codevision.pkgs.visualstudio.com/FStarLang/_packaging/fstarlang/nuget/v3/index.json

as advised gives following error

Error: Invalid option(s):
  FStarLang.DotNet.Common.ProjectTemplates.1.0::0.0.9

Is Framework 7 mandatory?

Projects generated with this template use net7.0
Since I do not have it, I change this to 6.0, and everything seems to be working fine.

Is the choice of 7 intentional? Will there be any problems if 6 is used?

VS syntax coloring - recommended solution

What would be recommended solution for syntax coloring with Visual Studio?

I found this deprecated extension for VSCode https://github.com/artagnon/vsfstar
I am not familiar with VSC extensions, but could syntax coloring rules be ported over to VS somehow?

Related to this - are there any info on possible continuation of this extension?

Adding FStar project to a VS solution error

  1. Created blank solution in VS2022
  2. Scaffolded FStar project using dotnet new fstarconsole -o helloworld
  3. Attempting to add project to a solution in VS2022 results in an error

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.