beefytech / beef Goto Github PK
View Code? Open in Web Editor NEWBeef Programming Language
Home Page: http://www.beeflang.org
License: Other
Beef Programming Language
Home Page: http://www.beeflang.org
License: Other
The full error is:
ERROR: Cannot perform binary operation '-' between two instances of type 'T'.
Some sample code to demonstrate the problem. I understand IOpNegatable only takes 1 parameter.
public struct MyRect<T> where T : IOpNegatable,
{
private T x;
private T y;
private T width;
private T height;
public static MyRect<T> fromTLBR(T top, T left, T bottom, T right)
{
return MyRect<T>(left, top, (right - left), (bottom - top));
}
public this(T x, T y, T width, T height)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
}
To remedy this I changed the interface to similar to IOpAddable:
interface IOpNegatable2
{
static Self operator-(Self lhs, Self rhs);
}
Not a big deal, just used to it being highlighted in visual studio.
'this.' is not highlighted yet 'this' without the dot is highlighted.
I tried to build the IDE and it failed.
(Git clone, open the relevant workspace, F7)
Is it ready for other people to try and do it themselves ?
In my first effort to change the font I replaced fonts/SourceCodePro-Regular.ttf with fonts/Consolas.ttf which popped up a very nasty crash whose UI was frozen (I couldn't scroll or see core dump either).
I managed to change font by simply having the word Consolas instead of fonts/Consolas.ttf (duh)
Reverse an array in-place.
Code modified from https://github.com/microsoft/referencesource/
ArrayExt.zip
Attached crash dump below
crash.zip
Happens when I run the Normal Test, the culprit is when I changed msg from'var' to 'let' in 'TestTagCount', otherwise compiles successfully.
using System;
public static int TagCount(StringView source, char32 value)
{
var count = 0;
if (source.IsEmpty == false)
{
for (var ch in source)
if (ch == value)
count++;
}
return count;
}
[Test]
public static void TestTagCount()
{
let msg = "message";
Test.Assert(2 == Utility.TagCount(msg, 'e'));
Test.Assert(1 == Utility.TagCount(msg, 'a'));
}
public abstract class ImageLoader
{
}
Reformat document with the above class and the public abstract becomes publicabstract one word.
Below example will cause the crash.
Attached crash dump.
extension_crash.zip
using System;
namespace System
{
extension Array
{
}
extension StringView
{
}
}
Beef IDE 0.42 c2ee4018
Settings Properties Visual Studio Tool Path (x64): C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64
Steps to reproduce (current workspace: SpaceGame, current Startup Project: SpaceGame):
Compiling...
Beef compilation time: 2.92s
500 modules built, 500 object files generated
Executing Command: CopyToDependents("$(ProjectDir)/dist/*.dll")
Command Time: 0.04s
Executing: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.24.28314\\bin\\Hostx64\\x64/link.exe" @C:\Users\michal\AppData\Local\Temp\tmp5AE1.tmp
Beef042RT64_ss.lib(Math.obj) : warning LNK4099: PDB 'BeefRT.pdb' was not found with 'Beef042RT64_ss.lib(Math.obj)' or at 'c:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame\BeefRT.pdb'; linking object as if no debug info
Beef042RT64_ss.lib(Internal.obj) : warning LNK4099: PDB 'BeefRT.pdb' was not found with 'Beef042RT64_ss.lib(Internal.obj)' or at 'c:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame\BeefRT.pdb'; linking object as if no debug info
Beef042RT64_ss.lib(Platform.obj) : warning LNK4099: PDB 'BeefRT.pdb' was not found with 'Beef042RT64_ss.lib(Platform.obj)' or at 'c:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame\BeefRT.pdb'; linking object as if no debug info
Beef042RT64_ss.lib(Thread.obj) : warning LNK4099: PDB 'BeefRT.pdb' was not found with 'Beef042RT64_ss.lib(Thread.obj)' or at 'c:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame\BeefRT.pdb'; linking object as if no debug info
Beef042RT64_ss.lib(closures.obj) : warning LNK4099: PDB 'BeefRT.pdb' was not found with 'Beef042RT64_ss.lib(closures.obj)' or at 'c:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame\BeefRT.pdb'; linking object as if no debug info
Beef042RT64_ss.lib(prep_cif.obj) : warning LNK4099: PDB 'BeefRT.pdb' was not found with 'Beef042RT64_ss.lib(prep_cif.obj)' or at 'c:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame\BeefRT.pdb'; linking object as if no debug info
Beef042RT64_ss.lib(ffi.obj) : warning LNK4099: PDB 'BeefRT.pdb' was not found with 'Beef042RT64_ss.lib(ffi.obj)' or at 'c:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame\BeefRT.pdb'; linking object as if no debug info
Beef042RT64_ss.lib(Common.obj) : warning LNK4099: PDB 'BeefRT.pdb' was not found with 'Beef042RT64_ss.lib(Common.obj)' or at 'c:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame\BeefRT.pdb'; linking object as if no debug info
Beef042RT64_ss.lib(String.obj) : warning LNK4099: PDB 'BeefRT.pdb' was not found with 'Beef042RT64_ss.lib(String.obj)' or at 'c:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame\BeefRT.pdb'; linking object as if no debug info
Beef042RT64_ss.lib(CrashCatcher.obj) : warning LNK4099: PDB 'BeefRT.pdb' was not found with 'Beef042RT64_ss.lib(CrashCatcher.obj)' or at 'c:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame\BeefRT.pdb'; linking object as if no debug info
Beef042RT64_ss.lib(UTF8.obj) : warning LNK4099: PDB 'BeefRT.pdb' was not found with 'Beef042RT64_ss.lib(UTF8.obj)' or at 'c:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame\BeefRT.pdb'; linking object as if no debug info
Execution time: 0.49s
Total build time: 3.50s
C:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame
FATAL ERROR
Unhandled error in result
Exception: Breakpoint (code 0x80000003) at address 7ff7'e90c0a8b in thread 578
Executable: C:\Program Files\BeefLang\Samples\SpaceGame\build\Release_Win64\SpaceGame\SpaceGame.exe
Logical Address: 0001:'0000fa8b
c5'35d8f770 7ff7'e90c0a8b SpaceGame.exe void Beefy::CrashCatcher::Crash(class Beefy::StringImpl const & __ptr64)+5B
Params: 251'815f2070 '0000000b '0000000b c5'35d8f859
c5'35d8f820 7ff7'e90be637 SpaceGame.exe BfpSystem_FatalError+157
Params: '00000001 '00000000 '00000000 c5'35d8f8a0
c5'35d8f850 7ff7'e90b9d5f SpaceGame.exe System.Result<void>.ReturnValueDiscarded+1F
at c:\Program Files\BeefLang\BeefLibs\corlib\src\Result.bf:82
Params: '00000002 '00000038 '00000001 251'8156a1a0
c5'35d8f8c0 7ff7'e90b3943 SpaceGame.exe SpaceGame.GameApp.Init+23
at c:\Program Files\BeefLang\Samples\SpaceGame\src\GameApp.bf:45
Params: '00000000 251'8156aaa0 '00000028 7ff7'e90c35bf
c5'35d8f970 7ff7'e90b4ce1 SpaceGame.exe SpaceGame.Program.Main+31
at c:\Program Files\BeefLang\Samples\SpaceGame\src\Program.bf:21
Params: 251'8156aaa0 251'815788c0 80000000'00000001 7fffffff'ffffffff
c5'35d8f9a0 7ff7'e90bd549 SpaceGame.exe BeefStartProgram+9
Params: 251'8156aaa0 '00000000 '00000001 7ff7'e90df588
c5'35d8f9d0 7ff7'e90bd52c SpaceGame.exe WinMain+7C
Params: '00000001 '00000000 '00000000 '00000000
c5'35d8fa10 7ff7'e90c32be SpaceGame.exe __scrt_common_main_seh+106
at d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
Params: '00000000 '00000000 '00000000 '00000000
c5'35d8fa40 7ffe'aa4a7bd4 KERNEL32.DLL BaseThreadInitThunk+14
Params: '00000000 '00000000 '00000000 '00000000
c5'35d8fac0 7ffe'abe2ced1 ntdll.dll RtlUserThreadStart+21
Params: '00000000 '00000000 '00000000 '00000000
RAX:'00000000 RBX:c5'35d8f7d0 RCX:'ffffffff RDX:7ff7'e9127890 RSI:'0000000b RDI:7ff7'e9127420
R8:'00000000 R9:7ff7'e90b0000 R10:7ff7'e9127890 R11:251'815f1b90
R12:'00000000 R13:'00000000 R14:'0000000c R15:7ff7'e9113290
EIP:7ff7'e90c0a8b ESP:c5'35d8f750 EBP:c5'35d8f800
CS:0033 SS:002B DS:002B ES:002B FS:0053 GS:002B
Flags:'00200202
I have a recent Windows 10 version (1909 build 18363.535) and just installed the Visual Studio Build Tools 2019 after getting prompted to do so during Beef installation. During installation I checked C++ build tools, and inside them I additionally checked C++ Clang Tools because I thought they may be needed.
cmd
and typing where
- there is where.exe
output from %SystemRoot%\System32 executablecmd
again - now where is not recognized as an internal ...
.where
is back in next cmd
launchThe program below gives the following error, which only happens if:
F1
and F2
are defined and both have nullable parameters,F2
is qualified with the namespace (type ofF1
could also be just int?
).ERROR: User-defined conversion must convert to or from the enclosing type
while specializing type 'int?' at line 79:53 in .../BeefLibs/corlib/src/Nullable.bf
public static implicit operator Nullable<T>(T value)
^
Errors: 1.
Compile failed.
using System;
namespace Issue
{
public typealias I = int;
public class Program
{
public static int Main(String[] args)
{
return 0;
}
public static void F1(Issue.I? i) {};
public static void F2(Issue.I? i) {};
public void M(I i)
{
F1(i);
}
}
}
private const int DefaultSize = (Int)(1024 * 16);
I expected these two types could be used interchangeably (are they not the same?)
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -MT src/x86/sysv.lo -MD -MP -MF src/x86/.deps/sysv.Tpo -c ../src/x86/sysv.S -fPIC -DPIC -o src/x86/.libs/sysv.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -MT src/x86/sysv.lo -MD -MP -MF src/x86/.deps/sysv.Tpo -c ../src/x86/sysv.S -o src/x86/sysv.o >/dev/null 2>&1
/bin/sh ./libtool --tag=CC --mode=link gcc -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -o libffi_convenience.la src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo src/x86/sysv.lo
libtool: link: ar cru .libs/libffi_convenience.a src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi64.o src/x86/.libs/unix64.o src/x86/.libs/ffi.o src/x86/.libs/sysv.o
libtool: link: ranlib .libs/libffi_convenience.a
libtool: link: ( cd ".libs" && rm -f "libffi_convenience.la" && ln -s "../libffi_convenience.la" "libffi_convenience.la" )
/bin/sh ./libtool --tag=CC --mode=link gcc -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -no-undefined -version-info grep -v '^#' ../libtool-version
-o libffi.la -rpath /usr/local/lib/../lib64 src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo src/x86/sysv.lo
libtool: link: gcc -shared -fPIC -DPIC src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi64.o src/x86/.libs/unix64.o src/x86/.libs/ffi.o src/x86/.libs/sysv.o -O3 -march=core2 -Wl,-soname -Wl,libffi.so.6 -o .libs/libffi.so.6.0.1
libtool: link: (cd ".libs" && rm -f "libffi.so.6" && ln -s "libffi.so.6.0.1" "libffi.so.6")
libtool: link: (cd ".libs" && rm -f "libffi.so" && ln -s "libffi.so.6.0.1" "libffi.so")
libtool: link: ar cru .libs/libffi.a src/prep_cif.o src/types.o src/raw_api.o src/java_raw_api.o src/closures.o src/x86/ffi64.o src/x86/unix64.o src/x86/ffi.o src/x86/sysv.o
libtool: link: ranlib .libs/libffi.a
libtool: link: ( cd ".libs" && rm -f "libffi.la" && ln -s "../libffi.la" "libffi.la" )
make[3]: Leaving directory '/home/michal/Playground/Beef/BeefySysLib/third_party/libffi/x86_64-unknown-linux-gnu'
make[2]: Leaving directory '/home/michal/Playground/Beef/BeefySysLib/third_party/libffi/x86_64-unknown-linux-gnu'
make[1]: Leaving directory '/home/michal/Playground/Beef/BeefySysLib/third_party/libffi/x86_64-unknown-linux-gnu'
Building LLVM...
build.sh: line 22: cd: ../extern: No such file or directory
I hope Beef can have compile-time reflection like d language.
It is declared as DPI-aware but no actual DPI aware support present => extremely small text size on hi-dpi screens
The IDE seems to be hardcoded to write tab characters instead of spaces when indenting code.
Please add an IDE option for using space characters (
) for indentation and an option for how many characters wide the indentation should be.
The following program causes internal parsing error in BfReducer.cpp
.
using System;
namespace Issue
{
public class Program
{
public static int Main(String[] args)
{
function void() dlg = => F<int>;
dlg();
return 0;
}
static void F<T>()
{
}
}
}
I suppose Socket class supports only windows as of now, support of linux is much appreciated.
Also it seems that we are linking to Clib function which are windows only for linux (like closesocket).
We have 'public bool EndsWith(char8 c)' but not StartsWith(char8 c).
Oops should of mentioned in the String class :)
Scanning dependencies of target llvm-lto
[ 87%] Building CXX object tools/llvm-lto/CMakeFiles/llvm-lto.dir/llvm-lto.cpp.o
[ 87%] Linking CXX executable ../../bin/llvm-lto
collect2: fatal error: ld terminated with signal 9 [Ucciso]
compilation terminated.
tools/llvm-lto/CMakeFiles/llvm-lto.dir/build.make:254: recipe for target 'bin/llvm-lto' failed
make[2]: *** [bin/llvm-lto] Error 1
make[2]: *** Eliminazione del file "bin/llvm-lto"
CMakeFiles/Makefile2:21697: recipe for target 'tools/llvm-lto/CMakeFiles/llvm-lto.dir/all' failed
make[1]: *** [tools/llvm-lto/CMakeFiles/llvm-lto.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
Sadly Linux build didn't work, I'm using Linux Mint 19.3.
Does anyone have some clues? Also the building process was very slow (some hours), is this usual?
I downloaded release 0.42, installed the binaries on windows 10. Started the IDE and picked the Hello World example which loaded into the IDE window. I selected build F7, and build was successful. Ctrl F5 to run, worked great. However playing around I noticed that if I selected Test -> Run -> Normal Tests the IDE crashed with the following dump:
Crash minidump saved as C:\Program Files\BeefLang\bin\CrashDumps\BeefIDE_20200113_200332.dmp
Exception: Access Violation (code 0xc0000005) at address 7ff7'b9741e38 in thread 40FC
Executable: C:\Program Files\BeefLang\bin\BeefIDE.exe
File Version: 0.42
Product Version: c2ee401
Logical Address: 0001:'001d0e38
c2'809fefb0 7ff7'b9741e38 0001:'001d0e38 BeefIDE.exe
Params: '00000000 7ff7'b977d0b4 28c'e01a3850 576e9952'4d52a49e
c2'809feff0 7ff7'b9741f67 0001:'001d0f67 BeefIDE.exe
Params: 28c'cdee0000 7ffd'd2b0922b '00000040 '00000004
c2'809ff960 7ff7'b9619bbc 0001:'000a8bbc BeefIDE.exe
Params: '00000000 '00000000 '00000000 '00000002
c2'809ff9a0 7ff7'b9767410 0001:'001f6410 BeefIDE.exe
Params: '00000000 '00000000 '00000000 '0000060c
c2'809ff9d0 7ffd'94783dcd Beef042RT64.dll unsigned long bf::System::Threading::Thread::GetProcessDefaultStackSize(void)+9D
Params: 28c'df687ef0 '00000000 '00000000 '00000000
c2'809ffa00 7ffd'd0c84034 KERNEL32.DLL BaseThreadInitThunk+14
Params: '00000000 '00000000 '00000000 '00000000
c2'809ffa50 7ffd'd2b63691 ntdll.dll RtlUserThreadStart+21
Params: '00000000 '00000000 '00000000 '00000000
RAX:4c'00000012 RBX:'00000000 RCX:4c'00000012 RDX:'00000000 RSI:28c'de715ca8 RDI:4c'00000012
R8:28c'de715ca8 R9:7ff7'b95701ff R10:'00000100 R11:28c'e01a3860
R12:'00000000 R13:7ff7'b9786758 R14:c2'809fefe8 R15:'0000000a
EIP:7ff7'b9741e38 ESP:c2'809fef50 EBP:'00000000
CS:0033 SS:002B DS:002B ES:002B FS:0053 GS:002B
Flags:'00010246
Test2 works as expected.
Test1 is with the static modifier and won't let me assign to the variable _list.
public class Test2
{
private readonly int[] _list;
this()
{
_list = new int[10];
}
}
public static class Test1
{
private static readonly int[] _list;
static this()
{
_list = new int[10];
}
}
The way the former is used makes it pretty obvious. And it looks like the latter is beef's way of making variadic functions?
Recursive enum cases currently cause both the IDE and beefbuild
to crash, which, in addition to making it impossible to implement something like an arithmetic expression tree, makes it difficult to implement any other kind of tree structure which might refer to itself in some way, such as a JSON value (at least in the IDE's case)
This crashes both the IDE and the compiler without fail:
enum Expression
{
case Number( double x );
case Add( Expression left, Expression right );
// other arithmetic operations
}
And this will crash just the IDE when typed out normally:
enum JsonValue
{
case Null;
case Array( JsonValue[] items );
}
The IDE crashes just after inserting JsonValue
when declaring the Array
case before even being able to insert the square brackets, requiring some other external editor, but otherwise it works as expected once that's sorted out.
I'm assuming naked recursion (such as in example 1) without putting the Self
behind a pointer, array, or some other form of indirection is intended since doing the same thing with a struct correctly produces an error without crashing.
As an aside, what is the idiomatic way of writing the first snippet properly? Pointer? Some kind of Box<T>
like Rust?
public static void Search(StringView source, char8[] divider)
{
var position = Array.BinarySearch(divider, 0, divider.Count, 'a');
}
Can't implement because its a built-in type - had this problem with other types such as int as well
c:\beef-master\idehelper\beef\bfcommon.h(18): fatal error C1083: Impossible d'ouvrir le fichier include : 'llvm/ADT/SmallVector.h' : No such file or directory [C:\Beef-master\Debugger64\Debugger64.vcxproj]
(unable to open "llvm/ADT/SmallVector.h" because it's not "there".) It exists a SmallVector.h in C:\Beef-master\llvm-project_8_0_1\llvm\include\llvm\ADT though.
So for these reasons I am unable to check my fix to #13 (comment)
Trying to get a sense of how much work is involved in getting the IDE GUI to run on Linux. I hacked out all the compile errors, but I then get an LLVM error when I try to build. Steps to reproduce:
bin/build.sh
./IDE/dist/BeefBuild -proddir=IDE -clean -config=Debug_NoDeps
The output I get is:
[*****************Call parameter type does not match function signature!
i8* %0
i32 %4 = call i32 @BfpSystem_SetCommandLine(i8* %0, i8* %1)
in function WinMain
LLVM ERROR: Broken function found, compilation aborted!
static void SomeRef(ref int i) { }
static void NoRef(int i)
{
SomeRef(ref i);
}
"Cannot use 'ref' on parameter 'i'. Consider adding 'ref' specifier to parameter or copying to a local variable"
This is valid syntax in C#, probably the parameter is shadowed on stack if not already passed on stack.
Later edit: Later I saw that this is a direct consequence of the fact that value parameters cannot be used inside a function:
void SomeFunc(int i) { i = 0; } //=> error.
using System;
using System.Diagnostics;
namespace Buffer
{
class CircularBuffer
{
private const int DefaultSize = (1024 * 2);
public uint8[] _data;
public this(int size = DefaultSize)
: base ()
{
Debug.Assert(size > 0);
_data = new uint8[size];
}
[Test]
public static void TestBuffer()
{
var buffer = new CircularBuffer();
Debug.Assert(buffer._data.Count == CircularBuffer.DefaultSize);
}
}
}
Running the above test in debug mode seg faults _data is not allocated, only seems to happen during testing.
While running the build.sh script I came across an error once it hits the IDEHelper build
the extern directory is not in the IDEHelper directory but in the root directory of the compiler(Beef-0.42.1)
Starting build.sh
-- Configuring done
-- Generating done
-- Build files have been written to: /home/developer/devprojects/Beef-0.42.1/jbuild_d
[ 5%] Built target hunspell
[ 74%] Built target BeefySysLib
[ 92%] Built target IDEHelper
[ 93%] Built target BeefBoot
[100%] Built target BeefRT
-- Configuring done
-- Generating done
-- Build files have been written to: /home/developer/devprojects/Beef-0.42.1/jbuild
[ 75%] Built target hunspell
[ 75%] Built target BeefySysLib
[ 75%] Building CXX object IDEHelper/CMakeFiles/IDEHelper.dir/BfDiff.cpp.o
In file included from /home/developer/devprojects/Beef-0.42.1/IDEHelper/../extern/llvm-project_8_0_0/llvm/include/llvm/Support/AlignOf.h:17:0,
from /home/developer/devprojects/Beef-0.42.1/IDEHelper/../extern/llvm-project_8_0_0/llvm/include/llvm/ADT/SmallVector.h:18,
from /home/developer/devprojects/Beef-0.42.1/IDEHelper/Beef/BfCommon.h:18,
from /home/developer/devprojects/Beef-0.42.1/IDEHelper/BfDiff.cpp:11:
/home/developer/devprojects/Beef-0.42.1/IDEHelper/../extern/llvm-project_8_0_0/llvm/include/llvm/Support/Compiler.h:18:10: fatal error: llvm/Config/llvm-config.h: No such file or directory
#include "llvm/Config/llvm-config.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
IDEHelper/CMakeFiles/IDEHelper.dir/build.make:62: recipe for target 'IDEHelper/CMakeFiles/IDEHelper.dir/BfDiff.cpp.o' failed
make[2]: *** [IDEHelper/CMakeFiles/IDEHelper.dir/BfDiff.cpp.o] Error 1
CMakeFiles/Makefile2:196: recipe for target 'IDEHelper/CMakeFiles/IDEHelper.dir/all' failed
make[1]: *** [IDEHelper/CMakeFiles/IDEHelper.dir/all] Error 2
Where exactly is the language/compiler's source code located at? I've been looking through the directories and can't seem to find it.
Hi! Thank you for releasing this project. I'm often looking for a language that is powerful and fast to compile that helps with experimentation :)
This issue may sound like a joke but it's not. I find it uncomfortable to look at a logo representing a sliced dead animal. Growing large animals for human consumption is also a contributor to the climate problem. I guess so far I'm part of a small but growing minority, but I thought I should still raise awareness to this. I know changing a name is a hard issue to fix.
Maybe Beef could be an acronym of something less bloody and the logo match that acronym?
Or if the authors are strong believers in raising animals for human consumption an option would be to fork the project and replace every mention of Beef with another word to appeal to a wider audience? Leaf sounds similar and has the same number of characters, but leaf-lang exists already.
In any case thank you for considering this.
Since Exceptions are not available:
For example, I looked into your DateTime implementation and constructors with out of range parameters call Runtime.FatalError(), which is not recoverable.
Building BeefBuild_bootd
[******************************]
TIMING: Beef compiling: 14.3s
WARNING: Enum value '2' for field 'Default' is not unique. Considering adding [AllowDuplicates] to the type declaration. Line 175:3 in /Users/jack/src/beef/Beef/BeefLibs/corlib/src/FFI/Function.bf
Default = Unix64
This value was previously used for field 'Unix64' at line 174:3 in /Users/jack/src/beef/Beef/BeefLibs/corlib/src/FFI/Function.bf
Unix64,
Errors: 0. Warnings: 1.
Linking BeefBuild_bootd...Undefined symbols for architecture x86_64:
"_ffi_call", referenced from:
bf::System::FFI::FFILIB::Call(bf::System::FFI::FFILIB::FFICIF*, void*, void*, void**) in libBeefRT_d.a(Internal.cpp.o)
"_ffi_closure_alloc", referenced from:
bf::System::FFI::FFILIB::ClosureAlloc(long, void**) in libBeefRT_d.a(Internal.cpp.o)
"_ffi_prep_cif", referenced from:
bf::System::FFI::FFILIB::PrepCif(bf::System::FFI::FFILIB::FFICIF*, bf::System::FFI::FFIABI, int, bf::System::FFI::FFIType*, bf::System::FFI::FFIType**) in libBeefRT_d.a(Internal.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
FAIL: Exit code returned: 1
FAILED
OS: Win 7 Pro SP 1
ERROR: Failed to load project 'Utility' from 'C:\Users\Damian Day\OneDrive\Programming\Beef\Utility\BeefProj.toml'
Actual location
C:\Users\dday.EPWGRP\OneDrive\Programming\Beef\Utility\BeefProj.toml
Also fails to load any linked project libraries.
Loading project on a networked station, dont have any problem loading on home PC.
return hasErrors ?.Err :.Ok; // equivalent to "if (hasErrors) return .Err else return .Ok
In the case above ?. is considered a single operator instead of two. This can be avoided by putting a space between ? and ., but since hasError is not a nullable, my expectation was that the compiler will figure it out.
When you create a new project in the workspace, the default value of Startup Object is Program, no namespace. But when you create a class in the IDE, named Program, it will be placed in the default namespace. I think the default value of Startup Object should including namespace.
You can not type any of the characters "{[]}~@|" in the IDE when using a german keyboard.
It does nothing when pressing the key combination alt-gr + key.
I git clone a repo and run a bin/build.sh. At the end i have 2 errors returned :
/usr/bin/ld: cannot find -ltinfo
collect2: error: ld returned 1 exit status
make[2]: *** [BeefBoot/CMakeFiles/BeefBoot.dir/build.make:173: Debug/bin/BeefBoot] Error 1
make[1]: *** [CMakeFiles/Makefile2:259: BeefBoot/CMakeFiles/BeefBoot.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
If you need more info, ask me
DeleteDictionyAndKeysAndItems
DeleteDictionyAndKeys
Are probably a typo for DeleteDictionary..
It does not appear in installed programs list and BeefUninstall.exe do nothing.
But it adds system variables and modify PATH when installed, I suspect after installation my PATH was broken until I restore it by hand
GetHashCode is declared private in primitive types.
public class Vector2 : IHashable
{
public int GetHashCode()
{
return X.GetHashCode() ^ Y.GetHashCode();
}
public float X;
public float Y;
}
In the following program the compiler segfaults in
BfModule::GetGenericParamInstance
on dereferencing mMethodInfoEx
which is null
. The problem is in the line marked with // issue
and
there is no problem in the previous line which uses delegate stored
in a local variable.
(It would be nice feature if compiler could determine generic argument T
from the delegate to omit explicit <String>
).
using System;
namespace Issue
{
class Program
{
public static int Main(String[] args)
{
var p = scope Program();
delegate void(String v) dlg = scope => p.Method;
p.Generic<String>(dlg);
p.Generic<String>(scope => p.Method); // issue
return 0;
}
public void Generic<T>(delegate void(T v) dlg)
{
}
public void Method(String v)
{
}
}
}
The following program segfaults compiler (it triggers assertion irValue.mId >= 0
in BfIRBuilder.cpp
line 1704 when runnig BeefBuild_d
at commit 2b0f7fb). When replacing scope S[1]
with scope S[0]
another assertion is triggered.
using System;
namespace Issue
{
public class Program
{
public static int Main(String[] args)
{
scope S[1];
return 0;
}
}
struct S
{
}
}
Hi,
I was trying to create the simplest console program and I get the following error:
Compiling...
Beef compilation time: 0.06s
ERROR: Unable to find entry point class 'Program' in project 'test_2'
0 modules built, 0 object files generated
Errors: 1.
Compile failed.
Changes not saved.
Workspace closed.
The after closing and restarting the project (and then the entire IDE) I get the following error:
ERROR: Project 'test_2' is not loaded. Retry loading by right clicking on the project in the Workspace panel and selecting 'Retry Load'
In the following program public
constructor cannot invoke private
constructor, failing to compile with error Too many arguments, expected 1 fewer
. But if private this
is replaced with protected this
the program compiles without problem.
namespace Issue
{
public class Program
{
public static int Main(String[] args)
{
return 0;
}
public this()
: this(0)
{
}
private this(int i)
{
}
}
}
Just installed the Beef IDE and created one of the samples, but get the following error message:
ERROR: Failed to load project 'corlib' from 'C:\Utilizadores\Pedro Silva\AppData\Local\BeefLang\BeefLibs\corlib\BeefProj.toml'
The correct folder name would be (without the space in the username PedroSilva
):
C:\Utilizadores\PedroSilva\AppData\Local\BeefLang\BeefLibs\corlib\BeefProj.toml
I would like to create a templated type which can be any numerical type, but at the moment I have to choose either IIntegral or IFloating, it would be useful to have a INumeric which combines the two.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.