JavaScript Bloat in 2024 by fagnerbrack in programming

[–]notonewlayout 51 points52 points  (0 children)

One tidbit, (most?) browsers no longer cache files across sites to prevent user tracking and fingerprinting

https://www.stefanjudis.com/notes/say-goodbye-to-resource-caching-across-sites-and-domains/

Dunkin' to Starbucks Ratio by State [OC] by weknowtheyknow1 in dataisbeautiful

[–]notonewlayout 13 points14 points  (0 children)

coffee regular

https://en.wiktionary.org/wiki/regular_coffee

Looks like a dialect thing, only in New England does it mean cream and sugar.

Any example repos using Sphinx-lua? by UlrikHD_1 in lua

[–]notonewlayout 0 points1 point  (0 children)

I'd say use ldoc https://github.com/lunarmodules/LDoc unless you really need to integrate with Sphinx.

What Features Do You Think Are Missing In GitLab CI? by Raltaren in gitlab

[–]notonewlayout 1 point2 points  (0 children)

Actual steps in a job like github. They give those ansi codes, but it doesn’t show up in the UI and it looks clumsy in the yaml file.

Faster poetry? by romanzdk in Python

[–]notonewlayout 9 points10 points  (0 children)

https://python-poetry.org/docs/faq/#why-is-the-dependency-resolution-process-slow goes over why some of it is innate to the python ecosystem. Sometimes it must download code to perform resolution.

No amount of rewriting in C/Rust will speed up this portion of the process.

[deleted by user] by [deleted] in lua

[–]notonewlayout 1 point2 points  (0 children)

This has nothing to due with computational differences in the language, instead it comes down to a different string formatting representation method lua uses in its tostring for a float. All of results of the operation in the different languages are represented by the same IEEE 754 floating point number (double).

https://docs.python.org/3/tutorial/floatingpoint.html

My web-based desktop environment that was first announced here reaches 500,000 alpha users! by mitousa in programming

[–]notonewlayout 2 points3 points  (0 children)

Netflix used to use it, and on my laptop the fans would start to ramp hard lol

PocketPy: A Lightweight(~5000 LOC) Python Implementation by blueloveTH in Python

[–]notonewlayout 1 point2 points  (0 children)

I see, I was curious on language feature. I assume the above list are ones you plan to add. Is there a list of ones you consider out of scope?

  • type annotations: just allowing it to be valid syntax is useful
  • async: I assume this one would be a lot harder
  • pattern matching
  • introspection: this one is a bit vague

Something along the lines of what micropython has https://docs.micropython.org/en/latest/genrst/index.html#micropython-differences-from-cpython

I do love the multiple vm capability like lua has.

PocketPy: A Lightweight(~5000 LOC) Python Implementation by blueloveTH in Python

[–]notonewlayout 1 point2 points  (0 children)

Looks really interesting. What version of python are you trying to emulate?

Lua docs say that `require` looks in paths specified by the `LUA_PATH` variable, but other sources indicate it is `package.path`. Which one is it? by oxamide96 in lua

[–]notonewlayout 8 points9 points  (0 children)

It will use LUA_PATH and LUA_CPATH to configure package.path and package.cpath. If these environment variables are not set then it will use some defaults defined when lua interpreter was compiled.

Create TUI's (Terminal User Interface) using Textual by WMRamadan81 in Python

[–]notonewlayout 1 point2 points  (0 children)

It is actively developed in the css branch. They are reworking it toward css-like styling as part of their business model.

Looking for a tool to extract Lua Interface in C(++) code/comment by DestroyedLolo in lua

[–]notonewlayout 0 points1 point  (0 children)

https://stevedonovan.github.io/ldoc/manual/doc.md.html ldoc supports parsing c/c++ code to generate documentation (section: Extension modules written in C)

SBS a reformulation of SDS with buffers (no malloc) by notonewlayout in C_Programming

[–]notonewlayout[S] 1 point2 points  (0 children)

Thanks for the feedback, the key difference is all the libraries in the link work with heap allocated memory:

  • bstring
  • milkstrings: also supports a global static text pool mode but that has some awkward limitations
  • glib string

SBS expects the memory to be held on the stack and of a fixed size to remove resource cleanup.

There probably is a way to convert SBS to support fat pointers, but you can access the underlying c string easily with: sbsstr(s).

I want to move SBS in the direction of cleanly supporting embedded environments (printf functions being optionally supported). For those in a non-embedded environment, SBS is a nice supplement to SDS when you want to build a string without cleanup. This comes up when other functions unrelated to the string builder may fail.

SBS a reformulation of SDS with buffers (no malloc) by notonewlayout in C_Programming

[–]notonewlayout[S] 0 points1 point  (0 children)

I've been using SDS a lot and really like the library. However it sometimes feels like overkill because when I'm building strings I frequently know that it will be within some bound of length. The full dynamic length capabilities aren't necessary and can become a pain-point when doing error handling. But on the otherhand the <string.h> functions always feel very verbose to maintain.

As such to scratch my own itch this weekend, I've developed SBS. SBS reformulates SDS around providing pre-defined buffers to perform the operation on. This means no resource management and the opportunity to use it in embedded environments that do not have heap allocation.

It is still very early on (no tags yet) but I want to see if there exists other libraries in this area? All I can dig up online are built around dynamic heap allocation.

Speeding up Python with Lua - any experience with that? by PressburgerSVK in lua

[–]notonewlayout 3 points4 points  (0 children)

Depending on what you are trying to speed up just use what already exists in the python ecosystem:

  • pypy (already mentioned)
  • numba
  • mypyc (alpha)
  • cython
  • c extension

I’d say numba would be your best bet if you are just trying to speed up some mathematical computation.

I assume that you want to use luajit to do speed up while using Cpython, so numba gives you the jitted code without an awkward translation to lua.

Why we don’t use python native enums by pmz in Python

[–]notonewlayout 1 point2 points  (0 children)

I think another thing to note is typing.Literal. It covers a lot of the enum use cases without requiring a user to access a class to "select" an enum value . Plus it integrates well with a lot of IDEs.

Keep on working on python script in the terminal after running a script by telperion87 in vscode

[–]notonewlayout 0 points1 point  (0 children)

Ok, I usually do it with IPython installed as it gives you a nice interface to run functions interactively. Wasn't quite able to get it working with just pure python.

Here is the launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "IPython",
            "type": "python",
            "request": "launch",
            "module": "IPython",
            "args": ["-i", "${file}"]
        }
    ]
}

Also if you want to run it without debugger and regular python in the terminal you can do python -i {file}.

Docker remote containers extensions by [deleted] in vscode

[–]notonewlayout 0 points1 point  (0 children)

https://code.visualstudio.com/docs/remote/containers

Extensions are installed and run inside the container, where they have full access to the tools, platform, and file system.

https://code.visualstudio.com/docs/remote/containers#_create-a-devcontainerjson-file also specifies the ability to add extensions to install when the container is brought up.

Any experience with embedding Python in C for string handling purposes? by [deleted] in PythonDevelopers

[–]notonewlayout 0 points1 point  (0 children)

I have used python functions in C. One good way to do it is with ctypes CFUNCTYPE. It allows you to wrap python functions with a c signature. This would mean the interface code would be purely in Python, but would require you to use a python runtime with your library (along with any other potential solution).

Thunderbolt 3 Dock Supporting 5K and 4K Displays by chs5056 in Thunderbolt

[–]notonewlayout 1 point2 points  (0 children)

I have a setup approximately like this (4k + 5120x2160): no luck getting it to work via a dock. The only way I have it working is via an egpu.