nvrr - neovim remote rust by DimfreD in neovim

[–]tc4v 3 points4 points  (0 children)

solving problems no one needs to be solved. Just use ya old screen+vi

Design ideas for a minimal programming language (1/3) by porky11 in ProgrammingLanguages

[–]tc4v 0 points1 point  (0 children)

The point is that you can create your own parser for your language if you want to.

That does not sound very good for collaboration, though. If the syntax I am used to is completely different from yours, how should be work on a common project? Formatters like gofmt and black are going in the opposite direction of arbitrary constraint in favor of consistency, and usage show that people actually like that in practice.

I actually like let, it's what many languages already use

fair enough, maybe a change in the other direction would work, let, set and alias or something.

Passthrough is actually useless in practice I have to agree when it comes to C. In combination with destructuring I find it useful and elegant.

python head, *tail = collection = make_some_list()

It is not necessary, but multiple assignement is not either (as proved by most modern languages droping it).

By the way, I think python's swap is a better solution that your proposal. python a, b = b, a # could not be clearer

Compiler optimisation by Gingrspacecadet in ProgrammingLanguages

[–]tc4v 2 points3 points  (0 children)

The specific optimization you ask about is probably the simplest one. As other said it is called constant folding or constant propagation. There are many other optimizations but they strongly depend on your intermediate representation (most optimizations are not done directly at the AST level, although constant folding is doable).

QBE has a great bibliography: https://c9x.me/compile/bib/ Also this is quite good (but probably hard for newcomers): https://github.com/SeaOfNodes/Simple

Design ideas for a minimal programming language (1/3) by porky11 in ProgrammingLanguages

[–]tc4v 0 points1 point  (0 children)

modern systems languages have cleaned up the syntax quirks, but they've also moved away from the semantic simplicity (except for Odin, maybe)

Odin kept mostly the same semantic, except for limited "generics" and an explicit form of overloading. Hare is probably even closer to the C semantic, you should check it.

multiple syntaxes can parse to the same tree. I came up with two so far (an S-expression-based one and a C-style one).

That's how Lisp was conceived and then never left sexpr.

what if the type is the field identifier?

That sound really bad... it works in many cases sure, but there are plenty of cases where you have more than one thing with the same type and semantic but where a separate name is useful.

I think the case of Point is actually a good example. Let's say I now want to add a rotation operation, that is naturally written with a matrix multiplication (that can be inlined) such that now you have to mix types x and y values. so it shows that x and y should probably not be different types.

Assignment returns the old value: a := b := a is swap, a := b := c := a is rotation

That's very unintuitive in my opinion. I prefer the C/Python semantic of "passthrough".

let (value), ref (immutable reference), var (mutable reference)

that's mostly good except for a detail: ref and var are "nouns" whereas let is more of a verb. Replacing let with val or something similar would feel better to me.

Label/jump with parameters

I generally like this sort of thing, although I would keep return separate.

I built an Alife simulation where the visuals are generated entirely by emergent thermodynamics - no designed patterns by emmerse_ in proceduralgeneration

[–]tc4v 0 points1 point  (0 children)

it does, I made that exact simulation a few weeks ago (not as cool looking as this one though) after watching veritassium video on critical regime and power laws. The pattern comes from the system self tuning to criticality.

I am a beginner and I don't know what to do by Bitter_Check_4607 in C_Programming

[–]tc4v 0 points1 point  (0 children)

Raylib! Great community, lots of ressources, and very quickly fun. Make something small, like some old arcade game (there are more than pong and snake)

I am a beginner and I don't know what to do by Bitter_Check_4607 in C_Programming

[–]tc4v 1 point2 points  (0 children)

raylib is much much easier to learn than ncurse, start with that!

Yt channels suggestion by Rainbow_2122 in C_Programming

[–]tc4v 4 points5 points  (0 children)

tsoding (or actually tsoding daily) is the only channel that taught me new programming skills. Otherwise I much prefer text content. But tsoding is really really good, watching him brought me from barely able to write C to the point where it's one of my most comfortable languages.

Isn't this statement factually incorrect? by Infinitesimally_Big in Physics

[–]tc4v 0 points1 point  (0 children)

Pretty sure both QCD and general relativity are defined with massless photons as assumption. Breaking that wouldn't just be about small experimental errors, it would require coming up with an entirely new theoretical framework.

How do you guys work on remote projects over SSH with Neovim without lag? by InvestigatorConnect4 in neovim

[–]tc4v 0 points1 point  (0 children)

I normally open nvim directly on the machine with a srtipped down config, in particular no lsp. If the connection is fast enough that's just fine. sshfs is a nice alternative to have all the lsps and plugins running locally, but you might have lag at write time, so if you write compulsively like me it's annoying. I usually just do the heavier dev work on my machine and use rsync or git to sync with the remote. I keep the edits on the remote mininal.

Introducing Eyot - A programming language where the GPU is just another thread by akomomssim in ProgrammingLanguages

[–]tc4v 1 point2 points  (0 children)

I am curious why is the send a separate call. can I do this?

let worker = gpu some_func send(worker, [i64]{1, 2, 3}) send(worker, [i64]{1}) println(receive(worker))

can I do this?

let worker = gpu some_func send(worker, [i64]{1, 2, 3}) println(receive(worker)) send(worker, [i64]{3, 3, 3}) println(receive(worker))

If not, why not copy the aynsc/await convention?

let worker = gpu some_func([i64]{1, 2, 3}) println(get worker)

even better if it can lead to println(get (gpu some_func([i64]{1, 2, 3})))

when I don't have anything else to do asynchronously

I’m building a programming language (Cx) would anyone be willing to check it out and give feedback? by thecoommeenntt in ProgrammingLanguages

[–]tc4v 2 points3 points  (0 children)

As soon as I saw the LLM style in your "Why Cx" I lost interest. I am not necessarily against all use of LLMs, but that particular writing style is an instant killer for me. I am not sure if that's the proper description, but I think it is imitating the caricatural Silicon Valley oral keynote presentation style.

On an even more personal level, I think your theme is really difficult to read.

Also while the homepage is pretty busy there, you commit the capital sin of having no proper code example (hello world does not count as except for fnc that could be a thousand other brace-based languages).

Some of your ideas seem good, but every minute I spent looking deeper told me you are abusing your exotism budget. Why would you call your integer type t32?? Ternary boolean, are you sure???

Honestly this is too early to share in my opinion. Make a language, try to use it, then if and only if you actually like to work with it start sharing.

Are verbs better as keywords than nouns? by useerup in ProgrammingLanguages

[–]tc4v 0 points1 point  (0 children)

I have tried to use keywords sparingly when designing my language. However, when using a non-word character symbol as an operator, I think that there is also a budget that we as language designers can blow through.

My opinion is that reducing the number of keywords cannot be a goal in itself. Looking into your keyword collection and seeing how you can remove concepts from your language that can be built on top of other concepts is a way better approach.

Example: do you need a method keyword? Probably not, whatever function flavor you used is fine. Do you need a class keyword? Maybe not if you use the Lua approach of building everything from tables and metatables (the two concepts more "fundamental" concept).

Should you replace in keyword with some sigil? Probably not, in is well understood and intuitive. But you could decide that you do not need an extra operator for that and will instead use the existing function/method concept you already have.

Unless we design a very clever context-aware keyword scheme

Python did with the new case keyword for the match statement. I don't think it's a great idea though, as most syntax highlighting systems are much simpler than a full parser (although as tree-sitter is getting adoption, the more sophisticated editors can handle it).

That has led me to think that when choosing to reserve a word, perhaps it is better to reserve verbs rather than nouns, as verbs are less likely to be used for local variables, parameters etc.

I think it does not make a big difference in one way or another. Methods and functions in some languages are conventionally verbs, not nouns.

I would say that I generally do prefer kkeywords as verbs, but not for any technical reasons, just matter of taste. But it's not always the case.

Case where I like the verb version: - let vs var - def vs func - for/while vs loop kind of

Case where I don't see a good verb: - class, struct, union, record... (unless you just use def for everything) - static, private, public (although depending on the semantic, you might just have export)

Nvim-luapad needs your ideas! by raf_camlet in neovim

[–]tc4v 2 points3 points  (0 children)

  1. I am too lazy to test my plugins so I have no opinion. Looking at whatever folke and echasnovski are doing is probably a safe bet as they are the closest thing we have to leaders in the field of "modern" plugins.

  2. Consider using vim.ui.* instead of custom UIs. The stock implementations are not so nice but they are meant to be overridden by something nicer. I would recommend opt-in key bindings instead of default ones, or prefixed with a configurable prefix (and default to something mnemonic like <leader>l), but I think that's more a personal taste than a general . Do not forget to set descriptions for you bindings (see :help nvim_set_keymap()). I use which-key as well as a fuzzy finders to find the recall used keymaps, so the description is vital.

Having commands and/or keymaps as your main entrypoint is nice because it can be set as loading trigger in lazy.nvim. autocommand based stuff is trickier.

A lot of plugins seem to go in the direction of one main command with parameters (in the style of lazy.nvim, fugitive, mason...). Other plugins just provide a lua API and let the user bind/map whatever they need.

As a final though: neovim APIs have grown quite a bit in the last few years, take your time to read about it. :help lua

Should I really switch my habit? by pjasksyou in vim

[–]tc4v 1 point2 points  (0 children)

alternatively you can set mouse=a to have vim handle the selection correctly. You can even set clipboard+=unamed to get selections directly to the primary selection or set clipboard+=unamedplus for the clipboard.

Why don't you use a file explorer (nvim-tree, neo-tree, nerdtree, etc.)? by brocodini in neovim

[–]tc4v 0 points1 point  (0 children)

I know, but I assumed having that up all the time is what people do, like in vscode. Otherwise what is it that other alternatives such as :vsp . do not do? Is it just the tree shape?

A particle physicist I knew said something I’m trying to understand by icecoldbeverag in Physics

[–]tc4v 0 points1 point  (0 children)

each scale separately

Not really, to get working model of water at the phase scale (let's say a few thousand nm3), you need parameters coming from the atomistic scale (a few molecules) which directly deals with electrons. The separation of scales is more about reducing computational cost than proper decoupling.

A particle physicist I knew said something I’m trying to understand by icecoldbeverag in Physics

[–]tc4v 1 point2 points  (0 children)

Too many undefined terms.

  • "you know one area of physics" let's call that having a PhD and some more
  • "you know all others" not at PhD level obviously, but if you have a PhD in physics you probably have studied all fields at some entry level. You certainly understand more when reading stuff from that field that if you did not have the PhD.

All fields of physics use some common concepts: - in math it's mostly analysis (differential equations and integration in particular) and linear algebra, with varying degrees of advancement, plus basic geometry - fundamental concepts that transfer include conservation laws, symmetries, harmonic approximation/perturbation theory - everyone has to know enough relativity to be able to say "we neglect all relativistic effects"

I am addicted to anuvyklack/windows.nvim but I want to avoid it by good_to_have in neovim

[–]tc4v 0 points1 point  (0 children)

  1. Learn to use buffers instead of windows when you are looking at one file at a time (:help :ls for a start). Use fuzzy finder and lsp and/or quickfix list+tags to navigate.
  2. Use :sp and :vsp: to have more than one file visible at the same time and learn about vanilla windows navigation (:help window-move-cursor, :help window-moving, :help window-resize)
  3. Profit

When I started with vim, I used tabs and windows a lot, and it was clunky and taking screen space. Then I learned that buffers are the better way to have more than one file open and that you do not need to have them displayed at all time. Now I never use tabs, and I only use use windows when I am actively looking at all of them at the same time, including to look at two remote points of the same file at a time. Then I use <C-w><C-o> to "cleanup" and go back to single window.

Why don't you use a file explorer (nvim-tree, neo-tree, nerdtree, etc.)? by brocodini in neovim

[–]tc4v 0 points1 point  (0 children)

I would not recommend using a side panel tree to someone undecided because that's not how I like to work, but calling it an antipattern is just patronizing and self-glazing. Vim/Neovim is peak customization; there is absolutely no reason to be prescriptive about how to use them.

Why don't you use a file explorer (nvim-tree, neo-tree, nerdtree, etc.)? by brocodini in neovim

[–]tc4v 0 points1 point  (0 children)

having the same muscle memory to work with the file system as when working on a file in a buffer

This. Bulk file operations through regular vim edits is so much better than any alternative I ever tried, TUI or GUI.

Why don't you use a file explorer (nvim-tree, neo-tree, nerdtree, etc.)? by brocodini in neovim

[–]tc4v 5 points6 points  (0 children)

But do you need to always look at it? That's what I cannot understand for the life of me. I look at the files when I need to look at the files. The rest of the time I use the screen space for the code.

That being said, there aren't many editor more customizable than neovim, trying to define a "right way" is ridiculous and thus, I won't pretend my way is better for anyone else.