s-expressions / pose

Portable S-expressions (POSE) spec and libs
29 stars 3 forks source link

+F# implementation #4

Closed wallymathieu closed 3 years ago

lassik commented 3 years ago

Great stuff, thank you very much!

Is the dotnet directory significant? All the other implementations are in the root directory of the repo so far (except Go which requires its own subdirectory in order for the tests to run).

lassik commented 3 years ago

A C# implementation would be nice as well. I can write one, or if you know the language and have the dev tools at hand, I don't mind if you want to do it.

lassik commented 3 years ago

Oh yeah, please add a SPDX license comment at the top of the file:

// Copyright 2021 Your Name
// SPDX-License-Identifier: MIT

Otherwise it's easy to lose track of who wrote each file over time. I'm missing the comments in some of the files I wrote as well; will add.

Would be a good idea to decide what license to use. MIT License is the traditional one in the Lisp community. ISC is like MIT but even shorter. Does the F# community have a de facto standard license that they like to use for libraries?

lassik commented 3 years ago

Thanks for crediting me but please add a second copyright line for yourself as well since you wrote the stream wrapper :D

wallymathieu commented 3 years ago

It's mostly straight translation of the SML code, the stream wrapper is kind of trivial since it's only a wrapper around existing .net API:s.

lassik commented 3 years ago

OK, fair enough.

Does the code need to be in a dotnet directory in order to work, or is that the usual custom to have in the .NET community? If we added a C# implementation, would we put in that directory as well?

wallymathieu commented 3 years ago

The directory is kind of arbitrary. The code only assumes that it's in a directory next to the examples folder. Note the tests are basically the same as seen in the Go source.

wallymathieu commented 3 years ago

Since it's a F# script file we could move the file into the source folder ...

lassik commented 3 years ago

Maybe we should start preparing for the future by moving each language into its own subdirectory. Ideally the implementation for each language comes with its own test program and maybe some project files. The root directory gets messy if they're all in there.

Would it make sense for all .NET langauges to share the same subdirectory, or should we put them into different ones? You know better than I which way is considered better by the .NET folks. If same directory, we can keep the dotnet in your PR.

wallymathieu commented 3 years ago

Usually you have something like

in this case it would probably be better to move it into a F# directory. In the future you could then have:

then

for the C# implementation to match what you usually see in repositories nowadays

lassik commented 3 years ago

OK, sounds reasonable. Then it will be easy to split the repo if needed using git subtree or git-filter-repo.

Can you push one more commit to move the file into the fsharp directory you suggest? I'll squash-merge the PR.

lassik commented 3 years ago

I'll push a commit and then merge.

wallymathieu commented 3 years ago

A C# implementation would probably borrow more from the Go implementation since it is more C style than the F# implementation.

lassik commented 3 years ago

Good idea.