Skip to content
#

Nim

nim logo

Nim is a general-purpose systems programming language that's designed to be efficient, expressive, and elegant. The Nim compiler produces dependency-free binaries for most platforms as well as JavaScript for the web.

Here are 1,128 public repositories matching this topic...

Nim
mratsim
mratsim commented Nov 24, 2019

sizeof doesn't work for types that store Atomics. This would be useful to size the memory buffer for thread-safe memory allocators with what is left from the synchronization primitives.

import std/atomics

type
  Node = ptr object
    # works
    next: Atomic[pointer]

  MyChannel = object
    # type not defined completely
    back: Atomic[ptr int]

static:
  echo sizeof(N
PatrikValkovic
PatrikValkovic commented Feb 28, 2020

The Khronos reference page contains description of parameters and description of the behavior for every function. Wouldn't it be possible to add doc comments for the functions, so IDE can show it? I understand the function description is a bit cumbersome, as one description is usually related to multiple functions with similar functionality, however parameters description would help a lot.
I am c

andreaferretti
andreaferretti commented Dec 13, 2019

I have written some simple examples in Nimx, but it is not clear to me what kind of pattern to follow to create custom components. By this I mean:

  • either a customization of an existing component (say, buttons with a different style)
  • or some kind of new component that possibly does its own layout but includes other components (for instance a box containing multiple buttons, only one of whic
gabbhack
gabbhack commented Apr 2, 2020

Open Graph

Main page example:

<meta property="og:title" content="Nim forum">
<meta property="og:type" content="website">
<meta property="og:image" content="..."/>
<meta property="og:url" content="https://forum.nim-lang.org/">
<meta property="og:site_name" content="Nim forum">

Thread example:

<meta property="og:title" content="Thread title">
<m
jyapayne
jyapayne commented Apr 12, 2020

Given this simple struct

struct GPU_Target
{
    int w, h;
};

The output is:

# Importing /Users/joey/Downloads/scratch/testover.h
# Generated at 2020-04-12T08:53:24-06:00
# Command line:
#   /Users/joey/.nimble/pkgs/nimterop-#head/nimterop/toast --preprocess -f=ast2 --pnim --nim:/Users/joey/Nim/bin/nim /Users/joey/Downloads/scratch/testover.h

{.hint[ConvFromXto

Created by Andreas Rumpf

Released 2008

Repository
nim-lang/Nim
Website
nim-lang.org
Wikipedia
Wikipedia

Related Topics

c c-plus-plus javascript language python
You can’t perform that action at this time.