Jump to content

tinyBigGAMES

Members
  • Content Count

    68
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by tinyBigGAMES


  1. 14 minutes ago, dummzeuch said:

    This is one of my pet pevees with Github: It's difficult to find out which repository is the official one.

    (Especially since everybody keeps telling me: In git all repositories are equal,)

    Great question! On GitHub, it’s true that forks and even unrelated repos can use the same name, which can make it confusing. The official repo is always the one under the account or organization of the original project creator.
     

    Here’s some ways to help find it:

    • Check links on the official website or documentation—they’ll point to the real repo.
    • Look for lots of activity, stars, and contributions from known authors.
    • On a fork, you’ll see a “forked from \[original]” notice at the top—click it to go to the original.
    • Avoid repos with suspiciously new accounts or odd releases.

    When in doubt, always ask here in the group and we can confirm if you’ve got the right one.

    • Like 2

  2. This very same thing happened to me recently. Sigh. Someone copied (not forked) my OllamaBox repo, changed the README, and added a release—even though my repo doesn’t have a release yet. Their release was an obfuscated Lua script that no doubt does bad things when executed. My name was listed as a contributor on the repo. I reported the user to GitHub, and all their accounts were taken down. Yes, be very careful and always get your code from the official repo.

    • Like 3

  3.  

    Calling Delphi Developers!
    We’re cooking up something special — Logan: local generative aI, unleashed.

    Right now, we’re testing Logan’s long conversational memory and recall — think persistent, context-aware conversations that actually remember.

    If you're curious and want to help test it out (or just play), jump into our Discord:

    • https://discord.gg/tPWjMwK
    • Head to the #logan channel — you’ll find the source files there. Check out the usage notes at the top of UTestbed.pas to get started.

    Your input means a lot.
    I appreciate you. 

    Notice even when I intentionally spell incorrectly, it's able to discern correctly.


     


  4. 21 minutes ago, Stefan Glienke said:

    I am not implying anything or accusing you. Still, in the age of supply chain attacks and smuggling malicious code into open source repositories, anyone that blindly trusts some binary code they cannot build from source is acting grossly negligent.

    Absolutely, and I completely agree with your concern — it's a valid and important one. Transparency and build reproducibility are critical in today's security landscape, especially with the real risks around supply chain attacks.


    That's why I'm committed to eventually open-sourcing as much of the code as possible, including build instructions for everything that can be made public. In the meantime, I'm being cautious to stay within the bounds of licensing restrictions while still trying to provide something useful and trustworthy to the Delphi community. I respect that not everyone will be comfortable running binaries without full source, and I encourage that kind of caution.
     

    Thanks for bringing it up — it's a conversation worth having.

    • Like 1

  5. 1 hour ago, Stefan Glienke said:

    Putting the actual functionality into a res file where you are loading it from at startup looks very sus, to say the least.

    Additional source code will be released in future updates. Please note that parts of the low-level virtualization rely on a commercial library, so I’m taking care to respect its licensing terms while still contributing meaningfully to the Delphi open-source ecosystem. As development progresses, more of the surrounding implementation built on top of that foundation will be made publicly accessible. For now, the current release reflects the functional portions that are ready to share.

    Nothing "sus", just can't violate a commercial license agreement.


  6. Simple example showing how to do interop in libFPC between host and DLL. Note, when passing strings and you want the string experience vs passing PChar/PWideChar, use WideString. They are managed like string/UnicodeString but by the OS rather than Delphi/FPC. The memory manager is not shared across the DLL boundary, so this is necessary. In a real app, the TContext and any other things that are shared between the host/dll can be put in an include file or, depending on the complexity, a unit that is shared between them.
     

    type
      TContext = record
        GetVersion: function(): WideString; stdcall;
        Test1: procedure(const AValue: Int32); stdcall;
        Test2: procedure(const AValue: WideString); stdcall;
      end;
    
    function  Test07_GetVersion(): WideString; stdcall;
    begin
      Result := '1.0.0';
    end;
    
    function  Test07_GetDescription(): WideString; stdcall;
    begin
      Result := 'Testing interop between host and DLL';
    end;
    
    procedure Test07_Test1(const AValue: Int32); stdcall;
    begin
      MessageBox(0, PWideChar(Format('Int32: %d', [AValue])), 'Host EXE', MB_OK);
    end;
    
    procedure Test07_Test2(const AValue: WideString); stdcall;
    begin
      MessageBox(0, PWideChar(Format('WideString: %s', [AValue])), 'Host EXE', MB_OK);
    end;
    
    procedure Test07();
    const
      CCode =
      '''
      library source;
    
      uses
        sysutils,
        windows;
    
      type
        PContext = ^TContext;
        TContext = record
          GetVersion: function(): WideString; stdcall;
          Test1: procedure(const AValue: Int32); stdcall;
          Test2: procedure(const AValue: WideString); stdcall;
        end;
    
      procedure Run(const AContext: PContext); stdcall;
      begin
        MessageBoxW(0, PWideChar(UnicodeFormat('Version: %s', [AContext.GetVersion()])) , 'Context DLL', MB_OK);
        AContext.Test1(2025);
        AContext.Test2('This is a string from Context DLL');
      end;
    
      exports
        Run;
    
      end.
      ''';
    
    var
      LlibFPC: TLibFPC;
      LHandle: THandle;
      LContext: TContext;
      Run: procedure(const AContext: PContext); stdcall;
    begin
      LContext.GetVersion := Test07_GetVersion;
      LContext.Test1 := Test07_Test1;
      LContext.Test2 := Test07_Test2;
    
      // Create an instance of TLibFPC
      LlibFPC := TLibFPC.Create();
      try
        // Assign the Pascal source string to compile
        LlibFPC.SetProjectSource(psString, CCode);
    
        // Set the output path to the in-memory cache directory
        LlibFPC.SetOutputPathToCacheDir();
    
        // Turn off debug mode
        LlibFPC.SetDebugMode(False);
    
        // Compile the file and check for success
        if LlibFPC.Compile() then
        begin
          WriteLn('Created DLL...');                // Notify DLL creation
    
          // Attempt to load the DLL from cache
          LHandle := LlibFPC.LoadDLL();
          if LHandle <> 0 then
          begin
            WriteLn('Loading DLL...');              // Notify DLL load
    
            // Resolve the 'Test01' exported procedure
            Run := GetProcAddress(LHandle, 'Run');
            if Assigned(Run) then
            begin
              WriteLn('Extracted and running export...'); // Notify success
              Run(@LContext);                             // Execute the export
            end;
    
            FreeLibrary(LHandle);              // Unload the DLL after use
            WriteLn('Unloaded DLL...');
          end;
        end
        else
        begin
          WriteLn('Failed!');                        // Notify compile failure
        end;
      finally
        // Free the instance to release resources
        LlibFPC.Free();
      end;
    
      Pause();                                       // Wait for user input before exit
    end;

     


  7. 2 minutes ago, Rollo62 said:

    Thanks, this is a great library and introduction.
    Can your libFPC also be configured to generate and run an Pascal code in memory at specific periodic schedules, lets say like every 1st of April or so?
     

    Thanks! Sure, see Test04 and Test05 as examples of in-memory generation/execution. Just program the running host app to run at the specified time. It should work just fine. The possibilities are endless.

    • Thanks 1

  8. 🚀 NEW PODCAST ALERT: #libFPC Deep Dive! 🎧

    Just dropped a fresh episode exploring "FreePascal in your pocket" by @tinyBigGAMES! 💻

    We're unpacking how this portable compiler system lets you carry the power of #FreePascal wherever you go! Perfect for rapid prototyping and collaboration on the move. 🔥

    • 📱 Learn how libFPC makes Object Pascal development more accessible
    • 🛠️ Discover cross-platform capabilities without the bulk
    • 💪 Hear expert tips for maximizing this lightweight compiler

    Whether you're a Pascal veteran or curious about compact development tools, this episode has something for everyone!

    Listen now 🎙️



    Grab libFPC from GitHub:
    https://github.com/tinyBigGAMES/libFPC
     


  9. social.thumb.png.7c8bca353ef9839bffc8f7020f2aef25.png


    Sophora is a local generative AI toolkit for Delphi, powered by the DeepHermes-3

    model and the latest llama.cpp optimizations. It enables fast, efficient, and unified

    reasoning, making it ideal for AI-driven applications that require high-performance

    local inference without relying on external cloud services. With features like function

    calling, embedding generation, retrieval-augmented generation (RAG), and deep

    inference capabilities, Sophora provides developers with a versatile and powerful

    toolset for integrating AI into their Delphi projects. By supporting optimized

    execution on modern hardware, including compute capability 5.0+ GPUs via Vulkan

    for acceleration, it ensures smooth and efficient model operations.

    tinyBigGAMES/Sophora: Sophora - AI Reasoning, Function-calling & Knowledge Retrieval
     

     


  10. 36 minutes ago, shineworld said:

    There are other projects, eg: Chandra, Infero, jetLua, LMEngine, etc which are disapeared from git...

    Are become obsolete and replaced by some newone ?

    Yes.

    • Like 1


  11. 🚀 Explore My GitHub Projects! 🌟  
    Check out my current GitHub tools and libraries I’ve been working on!  


    🎮 JetInfero 
    Local LLM Inference Library  

    🎨 Aurora Game Toolkit
    Advanced Game Development Toolkit

    📦 JetZip
    Zip It Fast, Zip It Easy!

    🤖 Lumina
    Local Generative AI Toolkit

    🔥 Pyro
    Pyro Game Library for Delphi  

    🛠 CPas
    Static C Libraries for Delphi

    📀 PSFML
    SFML for Pascal Developers

    🧠 MemoryDLL 
    In-Memory DLL Loading & Execution for Pascal

    🕹 DSDL   
    SDL for Delphi Developers

    🌕 Callisto 
    Lua Scripting for Delphi

    📜 CScript 
    C99 Scripting Engine
     

    • Like 3

  12. What if you wanted an even smaller Lua integration for Delphi? Just using stock Lua 5.4.7+, statically linked directly into your Delphi executable with no external overhead, and automatic registration of native Delphi routines, all in a single unit? Introducing Chandra - Lua Scripting for Delphi.

    A client needed a tiny, simpler, but capable Lua scripting solution than my recently released PLUA. The Chandra.o file (just Lua compiled into a single translation unit) is linked directly into Delphi via {$L Chandra.o} with ~600kb overhead. It can directly register published Delphi class methods via RTTI.

    Enjoy, happy coding! 👀

    https://github.com/tinyBigGAMES/Chandra

    • Like 3
    • Thanks 1

  13. 4 hours ago, Patrick PREMARTIN said:

    Good idea for PLUA project. I've seen an old LUA package for Pascal but it wasn't maintained.

     

    @tinyBigGAMES You open many projects but globally only for Windows, do you want to try other platforms in the future ?

    Hi, thanks! At the moment, I'm only targeting Windows. Mostly because much of that audience is on Windows. I won't rule out other platforms, however. The products that I create are for clients using Windows. The libs are open source so if anyone wishes to port to other platforms, go for it. Note that often, a library may take express advantage of a feature that is limited or unique to the Windows platform, however. In the case of games for example, the last time I looked at the Steam stats, the vast majority of users there are still on Windows. It's no debate that Windows still has the best development tools, and it is still much easier to release on it. But, like I said, I'm not against it per say, just that for me, in the current moment, I have no need or desire to release anywhere else.

    • Like 3

  14. Here are a few more projects:

    • PLUA: Lua for Pascal
      PLUA is a lightweight and powerful 📦 that integrates LuaJIT scripting into Delphi, enabling you to easily add a scripting layer to your Delphi apps. Whether you're building dynamic software 🖥️, adding mod support 🛠️, or simply looking for a way to make your apps more flexible and customizable, PLUA makes this possible through simple, straightforward APIs.
    • CPas: Static C Libraries for Delphi
      A collection of hand-picked, high-quality C libraries, compiled into a single translation unit and seamlessly integrated into Delphi. This approach eliminates the need for external DLLs, runtime extraction, or loading them in memory, simplifying the development process and reducing potential compatibility issues, such as antivirus 🛡️ interference.
    • Mamba Game Toolkit: Advanced 2D Game Library for Delphi.
      Mamba Game Toolkit (MGT) is a sophisticated yet easy-to-use 2D game development library for Delphi. Tailored to meet the needs of Windows developers, MGT offers a streamlined approach to building 2D games, focusing on simplicity, performance, and reducing external dependencies. With everything linked directly into the executable️, it eliminates the need for runtime DLLs, simplifying deployment and enhancing the overall stability and reliability of your projects.

    Enjoy! 👀

    • Like 2
    • Thanks 2

  15. Here are a few recent projects I've created that might be useful to others:

    • CScript: C99 Scripting Engine for Delphi
      🅲🆂cript represents a sophisticated 🅲99 scripting engine meticulously crafted for experienced 🧑💻 Delphi developers. Leveraging the compact yet highly versatile TinyCC compiler, 🅲🆂cript seamlessly integrates ⚙️ dynamic backend code generation into the Delphi development environment. With 🅲🆂cript, Delphi developers can 🛠️ compile and execute 🅲 scripts at runtime, directly in 💾 memory, and generate output in the form of 🪟 Win64 executables (.exe), dynamic-link libraries (.dll), or 📂 object files (.obj).
    • MemoryDLL: In-Memory Win64 DLL Loading & Execution for Pascal.
      The MemoryDLL unit provides advanced functionality for loading dynamic-link libraries (DLLs) directly from memory in Win64 environments. Unlike traditional methods that involve loading DLLs from the file system, MemoryDLL allows you to load DLLs from byte arrays 📂 or memory streams 💾, retrieve function addresses, and unload them—all in-memory. This library is ideal for Delphi/FreePascal developers who need to manage DLLs without relying on the filesystem, enhancing both performance and security 🔒.
    • PSFML: SFML for Pascal
      PSFML is a Pascal binding for the  Simple and Fast Multimedia Library (SFML), providing Pascal developers with a straightforward way to utilize SFML’s multimedia features directly in their projects. Whether building 🎮 games, 🤖 interactive applications, or 🎥 multimedia tools, PSFML integrates smoothly with SFML, bringing robust multimedia functionality to the Pascal ecosystem.

    Enjoy! 👀

    • Like 9
    • Thanks 1

  16. 10 minutes ago, hsauro said:

    But you can now link lib files with your CPas since you say “Now you can link in static C libs directly into Delphi:”?

    Using the new Clang based C++ Builder (win64 modern platform), which can compile more C/C++ code than it could in the past, which means it is more likely to be able to compile your favorite C library. You compile the code to generate .o files, which Delphi can consume with {$L unit1.o} for example. I have a unit called CPas.CRuntime that references all the missing c runtime routines that the C lib may reference and thus allow Delphi to compile and use the static C library. Continue to update CPas.CRuntime as you encounter references that you may need. I have included a far bit already.


    Now you can link in static C libs directly into Delphi:
    means you can take your favorite C lib, such as sqlite and link inside the EXE vs calling it from a DLL. I have sqlite3 as an example in the repo. Not all of them will be possible, but you should be able to do more with the new tool chain than you ever could before. This does require 12.1+ 


  17. Dllama.png.dfea16179b4ec59d12401f29fc43574d.png

    Dllama, a simple and easy to use library for doing local LLM inference directly from Delphi (any language with bindings). It can load GGUF formatted LLMs into CPU or GPU memory. Uses Vulkan back end for acceleration.

    Simple Example

    uses
      System.SysUtils,
      Dllama,
      Dllama.Ext;
      
    var  
      LResponse: string;
      LTokenInputSpeed: Single;
      LTokenOutputSpeed: Single;
      LInputTokens: Integer;
      LOutputTokens: Integer;
      LTotalTokens: Integer;
    
    begin
      // init config
      Dllama_InitConfig('C:\LLM\gguf', -1, False, VK_ESCAPE);
    
      // add model
      Dllama_AddModel('Meta-Llama-3-8B-Instruct-Q6_K', 'llama3', 1024*8, '<|start_header_id|>%s %s<|end_header_id|>',
        '\n assistant:\n', ['<|eot_id|>', 'assistant']);
    
      // add messages
      Dllama_AddMessage(ROLE_SYSTEM, 'you are Dllama, a helpful AI assistant.');
      Dllama_AddMessage(ROLE_USER, 'who are you?');
    
      // display the user prompt
      Dllama_Console_PrintLn(Dllama_GetLastUserMessage(), [], DARKGREEN);
      
      // do inference
      if Dllama_Inference('llama3', LResponse) then
        begin
          // display usage
          Dllama_Console_PrintLn(CRLF, [], WHITE);
          Dllama_GetInferenceUsage(@LTokenInputSpeed, @LTokenOutputSpeed, @LInputTokens, @LOutputTokens,
            @LTotalTokens);
          Dllama_Console_PrintLn('Tokens :: Input: %d, Output: %d, Total: %d, Speed: %3.1f t/s',
            [LInputTokens, LOutputTokens, LTotalTokens, LTokenOutputSpeed], BRIGHTYELLOW);
        end
      else
        begin
          Dllama_Console_PrintLn('Error: %s', [Dllama_GetError()], RED);
        end;
      Dllama_UnloadModel();
    end.



     

     

    • Like 3
×