MoscaCareca
MoscaCareca
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
tyvm
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
ok I will, I'll get back to you if I have any issues
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
this one?
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
I'm assuming there's a way I can maybe have a little tool that compiles the C# files and executes them and call that tool in python?
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
I'm using Ollama but there's a C# API too
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
my problem with switching to C# is that I'm not nearly as efficient on it as I'm with python
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
I guess I should probably do that, yeah
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
The general idea is to see if code tuned LLMs can "autocomplete" small C# snippets, kinda like copilot does, but I need to be able to test it, which is why it has this weird format
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
because it was
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
That's why it feels like it was written as if C# was a scripting language
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
Basically, what's going on is the following: I have around 150 C# "problems" that I'm sending to a coding model one by one. Each problem follows this structure:
using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem
{
// Check if in given list of numbers, are any two numbers closer to each other than
// given threshold.
// >>> HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f})), (0.5f))
// (false)
// >>> HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.8f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f})), (0.3f))
// (true)
public static bool HasCloseElements(List<float> numbers, float threshold)
{
// Your code here
}

public static void Main(string[] args)
{
// Tests will go here
}

}
using System;
using System.Numerics;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
class Problem
{
// Check if in given list of numbers, are any two numbers closer to each other than
// given threshold.
// >>> HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f})), (0.5f))
// (false)
// >>> HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.8f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f})), (0.3f))
// (true)
public static bool HasCloseElements(List<float> numbers, float threshold)
{
// Your code here
}

public static void Main(string[] args)
{
// Tests will go here
}

}
where // Your code here is replaced by the model's response and // Tests will go here is replaced by a set of predefined tests. I then place this on a .cs file, after which I want to programmatically compile the .cs file which I was doing it by invoking csc using a subprocess. I check if the compiler threw an error and if not I just run the resulting .exe file and check if the tests passed. I hit a wall because some of the responses I'm getting use features from a language version later than C# 5, which csc does not support. I was hoping there was another plug-in option I could use, something as simple as installing a different compiler and calling a command akin to csc myfile.cs but as you've all told me, there isn't.
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
I can explain that to you, but I need to do something for the next 15mins. I assume it's okay if I just leave and come back
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
I'm not sure if I can, it's very machine learning dependent, python should be way better suited
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
they all have the same structure, only the first method and whatever is inside main changes
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
there's one
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
the idea is the same
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
yeah kinda
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
I have no clue how C# works tbh, I only really work with scripting languages I can just hit "run" and it runs
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
they are different files, not interconnected to each other and all define the same Problem class
72 replies
CC#
Created by MoscaCareca on 3/13/2025 in #help
C# 5+ compiler
do I need a project for each file I want to compile?
72 replies