Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6c19fcc
Thread class added
CrackAndDie Apr 15, 2026
2cbb169
Timeout and TimeSpan added
CrackAndDie Apr 15, 2026
9b3988d
Merge branch 'main' into dev/multithreading
CrackAndDie Apr 15, 2026
2ebdb42
TimeSpan files small fixes
CrackAndDie Apr 15, 2026
f203093
Merge branch 'main' into dev/multithreading
CrackAndDie Apr 15, 2026
1ba14b1
Int128 added and TimeSpan changes
CrackAndDie Apr 15, 2026
8e89f83
Merge branch 'main' into dev/multithreading
CrackAndDie Apr 15, 2026
f47b95d
Small changes in Int128
CrackAndDie Apr 15, 2026
1287291
Merge branch 'main' into dev/multithreading
CrackAndDie Apr 15, 2026
9589918
Many lines removed from Int128
CrackAndDie Apr 15, 2026
00272d2
Merge branch 'main' into dev/multithreading
CrackAndDie Apr 15, 2026
1f6d22f
Int128 more updates
CrackAndDie Apr 17, 2026
df86f22
Merge branch 'main' into dev/multithreading
CrackAndDie Apr 17, 2026
1025655
UInt128 added and small other changes
CrackAndDie Apr 17, 2026
dd26edd
Merge branch 'main' into dev/multithreading
CrackAndDie Apr 17, 2026
4c1e505
Removed ulong cast
CrackAndDie Apr 18, 2026
ae0d3ec
Merge branch 'main' into dev/multithreading
CrackAndDie Apr 18, 2026
b679ff5
Const field fix in Timeout.hpt
CrackAndDie Apr 18, 2026
71ea4ac
Merge branch 'main' into dev/multithreading
CrackAndDie Apr 21, 2026
725f662
Some cringe shite added for UInt128
CrackAndDie Apr 21, 2026
5111150
Merge branch 'main' into dev/multithreading
CrackAndDie Apr 21, 2026
09a85dc
Int128 and UInt128 probably done
CrackAndDie Apr 21, 2026
b9abce5
Merge branch 'main' into dev/multithreading
CrackAndDie Apr 21, 2026
fee918c
Some additional implementations for TimeSpan
CrackAndDie May 6, 2026
54df474
Merge branch 'main' into dev/multithreading
CrackAndDie May 6, 2026
cf52331
ThreadState and ThreadStateException added
CrackAndDie May 6, 2026
3a8d099
Merge branch 'main' into dev/multithreading
CrackAndDie May 6, 2026
07cce2e
Remove cringe thread state access
CrackAndDie May 7, 2026
1a1aa28
Unroll colorizer change
CrackAndDie May 7, 2026
0bb6ec2
Merge branch 'main' into dev/multithreading
CrackAndDie May 7, 2026
87a7e0a
ThreadPal for windows added and small fix in ConsolePal
CrackAndDie May 8, 2026
bb8108e
Merge branch 'main' into dev/multithreading
CrackAndDie May 8, 2026
c33943e
ThreadPriority added and props for name and pool
CrackAndDie May 8, 2026
a9a7afe
Merge branch 'main' into dev/multithreading
CrackAndDie May 8, 2026
9c478a8
Check that thread is already running in start
CrackAndDie May 8, 2026
8c95c2a
Merge branch 'main' into dev/multithreading
CrackAndDie May 8, 2026
3ef5bb0
Many things in windows threading added
CrackAndDie May 8, 2026
dc85563
Merge branch 'main' into dev/multithreading
CrackAndDie May 8, 2026
989df73
Current thread prop impl
CrackAndDie May 12, 2026
e5a0855
Merge branch 'main' into dev/multithreading
CrackAndDie May 12, 2026
3442cd1
Dictionary impl begin
CrackAndDie May 12, 2026
d924e47
Merge branch 'main' into dev/multithreading
CrackAndDie May 12, 2026
d39006b
Type extended and some fixes in dictionary
CrackAndDie May 12, 2026
b33d037
Merge branch 'main' into dev/multithreading
CrackAndDie May 12, 2026
e256ab3
Removed unused readonly kw from KVP
CrackAndDie May 13, 2026
4127e30
Merge branch 'main' into dev/multithreading
CrackAndDie May 13, 2026
9270468
HashHelpers and other shite added
CrackAndDie May 13, 2026
27feb50
Merge branch 'main' into dev/multithreading
CrackAndDie May 13, 2026
1b26c17
Small changes in ThreadStatic
CrackAndDie May 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion HapetBackend/Llvm/TypeInfo/TypeInfoGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ private void GenerateInitializerForTypeInfo(HapetType type)
int rawSize = (type is PointerType pp && pp.CreatedByCompiler ? pp.TargetType : type).GetSize();
LLVMValueRef rawSizeValue = LLVMValueRef.CreateConstInt(_context.Int32Type, (ulong)rawSize);

// is value type
LLVMValueRef isValueType = LLVMValueRef.CreateConstInt(_context.Int1Type, (ulong)(type is StructType ? 1 : 0));

_builder.BuildStore(LLVMValueRef.CreateConstNamedStruct(typeInfoType,
[interfaceOffsets, dtorDelegate, rawSizeValue]), globConst);
[interfaceOffsets, dtorDelegate, rawSizeValue, isValueType]), globConst);
}

private LLVMTypeRef _typeInfoType;
Expand Down
4 changes: 3 additions & 1 deletion HapetFrontend/Helpers/GenericsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@
return HasAnyGenericTypes(nullE);
else if (expr is AstIdExpr || expr is AstEmptyExpr || expr is AstNullableExpr)
return false; // just return false because OutType is checked above
Debug.Assert(false, "Unexcepted expr type to check");

// do not error, just skip this shite. probably errored somewhere above
// Debug.Assert(false, "Unexcepted expr type to check");

Check warning on line 307 in HapetFrontend/Helpers/GenericsHelper.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this commented out code.

See more on https://sonarcloud.io/project/issues?id=hapet-lang&issues=AZ4b_pXyPHKYqV3s_-Af&open=AZ4b_pXyPHKYqV3s_-Af&pullRequest=147
return false;
}

Expand Down
5 changes: 5 additions & 0 deletions std/System/Array.hpt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ public static class Array
array = newArray;
}

public static void Clear<T>(T[] array)
{
Marshal.Memset(array.Buffer, 0, array.Length * sizeof(T));
}

public static void Clear<T>(T[] array, int index, int length)
{
Marshal.Memset(array.Buffer + index, 0, length * sizeof(T));
Expand Down
20 changes: 20 additions & 0 deletions std/System/ArrayTypeMismatchException.hpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.


/// <summary>
/// The exception that is thrown when an attempt is made to store an element of the wrong type within an array.
/// </summary>
public class ArrayTypeMismatchException : SystemException
{
// Creates a new ArrayMismatchException with its message string set to
// the empty string, its HRESULT set to COR_E_ARRAYTYPEMISMATCH,
// and its ExceptionInfo reference set to null.
public ArrayTypeMismatchException() : base(SR.Arg_ArrayTypeMismatchException) { }

// Creates a new ArrayMismatchException with its message string set to
// message, its HRESULT set to COR_E_ARRAYTYPEMISMATCH,
// and its ExceptionInfo reference set to null.
//
public ArrayTypeMismatchException(string message) : base(message ?? SR.Arg_ArrayTypeMismatchException) { }
}
23 changes: 23 additions & 0 deletions std/System/BitConverter.hpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// Some modifications were made for hapet-lang compatibility.

using System.Runtime.CompilerServices;

/// <summary>
/// Converts base data types to an array of bytes, and an array of bytes to base data types.
/// </summary>
Expand All @@ -15,4 +17,25 @@ public static class BitConverter
#else
public static readonly bool IsLittleEndian = true;
#endif

/// <summary>
/// Converts the specified double-precision floating point number to a 64-bit signed integer.
/// </summary>
/// <param name="value">The number to convert.</param>
/// <returns>A 64-bit signed integer whose bits are identical to <paramref name="value"/>.</returns>
public static inline long DoubleToInt64Bits(double value) => Unsafe.BitCast<double, long>(value);

/// <summary>
/// Converts the specified double-precision floating point number to a 64-bit unsigned integer.
/// </summary>
/// <param name="value">The number to convert.</param>
/// <returns>A 64-bit unsigned integer whose bits are identical to <paramref name="value"/>.</returns>
public static inline ulong DoubleToUInt64Bits(double value) => Unsafe.BitCast<double, ulong>(value);

/// <summary>
/// Converts the specified 64-bit unsigned integer to a double-precision floating point number.
/// </summary>
/// <param name="value">The number to convert.</param>
/// <returns>A double-precision floating point number whose bits are identical to <paramref name="value"/>.</returns>
public static inline double UInt64BitsToDouble(ulong value) => Unsafe.BitCast<ulong, double>(value);
}
Loading