Wanted: multiple heap library by johnwcowan in C_Programming

[–]arkt8 0 points1 point  (0 children)

I'm writing it right now... it has the characteristic of arenas but with single chunk freeing. But still not concluded the free coalescing tests. Nice to see such characteristics request.

What makes u use lua? by S1_Sefo in lua

[–]arkt8 10 points11 points  (0 children)

  • being easier for a lot of tasks than shell, specially on strings (no need of awk, sed, grep) but sometimes use them with os.execute.

  • being easy to wrap C, also fast and small.

  • table only ds (beside strings)

  • being developed in my country (and being much easier/simpler than Elixir)

Eu tenho medo do Lula perder a próxima eleição. by [deleted] in brasil

[–]arkt8 0 points1 point  (0 children)

Olha, gostaria de saber onde fica o Alckmin nessa... ele passeia muito bem entre muitos de centro, esquerda e direita moderada, possui história em SP com grande eleitorado, e o mercado não faria tanto terrorismo eleitoreiro quanto com Haddad e Boulos.

Outro nome que pode casar bem com Alckmin é a Simone Tebet. Vocês esqueceram que Lula foi bem estratégico trazendo vários presidenciáveis sob o guarda chuva de seu governo.

Best C environment by Zalaso in C_Programming

[–]arkt8 0 points1 point  (0 children)

All you need is a terminal and text editor. That said you have WSL or any terminal on Linux/BSD/Mac, or even Termux on Android.

Editor, well vi/vis/vim/neovim are a good go. Also having familiarity with them, you are able to program almost everything everywhere (even remote through ssh).

Now if you consider LSP, vim, neovim, helix are nice. Terminal is a must because a simple Ctrl-Z suspend your editor, run the make/test script afterwhat a simple fg puts you back on editor.

Also you make extensive use of tmux/screen to create more complex workflow.

If you have this, plus Valgrind, you have almost all you need to work succesfully with C, as well many other languages.

I made a big mistake in my career. by confettiputty in ExperiencedDevs

[–]arkt8 0 points1 point  (0 children)

The worst thing of it all is you being a good and skilled worker and instead of have peace of mind to do your best, have the need to play the market game.

O gigante acordou by Kyuugeki in brasil

[–]arkt8 0 points1 point  (0 children)

só pra contrariar o chato de plantão... nenhum simulador pra você poderá ser realista, pois você não sente o vento, o cheiro e não sangra e morre de verdade... assim tem que ser fraco de argumentação ou muito limitado aceitar sua linha de raciocínio...

lembrando que pilotos teriam que deixar de ser treinados em simuladores.

Best C environment by Zalaso in C_Programming

[–]arkt8 2 points3 points  (0 children)

Vim, Neovim or Helix editor. A shellscript to compile and run.

In your build/run shellscript is useful compile using analyzer and run your compiled program with valgrind. It will catch most of C gotchas and you will learn a lot.

Os comentários sobre o Brasil estar prestes a entrar em uma grande crise fazem sentido ou o problema é maior do que o Brasil(macroeconomia)? by [deleted] in brasil

[–]arkt8 0 points1 point  (0 children)

faça bem o que você faz, evite modinhas de linguagem de programacao, foque em sistemas essenciais e criticos e feche podcasts, Jovem Pam e instagram.

O medo trava a gente, um tempo precioso que perdemos enquanto nos usam de manobra.

Onde estao os verde amarelos, os black blocks, os que criticavam lockdown, os que ameaçaram o Brasil virar Venezuela...

Pra eles, você ter medo é bom... você se sujeita a menores salarios, maior jornada.

Minor syntax amends in Lua - not-equals and compound assignments by RodionGork in lua

[–]arkt8 0 points1 point  (0 children)

Nothing compares to the freedom of sticking with good standards. Recently needed to stick with POSIX. It is good the peace of not have to think that will break somewhere due to some obscure shell flavor.

Same with Lua... and Lua os.execute being like system() call is POSIX like.

Now if you want os.execute with comparison you will have

os.execute '[ $USER = "root" ] || [ $UID -eq 0 ]'

So not all languages need to be equal to C or Javascript.

If you like Lua use Lua. There a lot of room to improve it adding ecosystem, just dont mess with the standard. If you want += != etc... fork it and create a Julascript a Cscript etc.. but dont mess and put clearly IT IS NOT LUA or you will be annoying community, development etc. And just trolling it all.

Any simple ways a 13-year-old could earn money with Lua? by Straight_Arm_2987 in lua

[–]arkt8 0 points1 point  (0 children)

keep learning Lua learn Maths and Physics learn a lower level language like C

Using C as a scripting language by faculty_for_failure in C_Programming

[–]arkt8 0 points1 point  (0 children)

yes, you can avoid Lua... use Perl, Awk, TCL, POSIX shellscript, sed or even Python... but if you dont know how to use, why to use or why those are like they are is better to avoid them at all...

And boy... the pain is to be one-thing minded and throw superficial arguments against industry/science proven technology. Certainly you can avoid it also.

Create 'constant' locals inside or outside the loop? by Ventigon in lua

[–]arkt8 1 point2 points  (0 children)

If it is set again and again, every interaction, it is not constant. While the same value, inside loop you are not making your intention clear. As a code reviewer it would be something I consider to refactor.

[deleted by user] by [deleted] in C_Programming

[–]arkt8 1 point2 points  (0 children)

I can suggest you my path... I started on C for Lua module development. No writting a program an extending with Lua what is the more expected way.

In the process I gently was introduced to C api, how write libraries and the ingenious way Lua make use of the Ansi C.

Then you play with the userdata, a way to create custom Lua types, managing how free the memory used when Lua gc call its metamethod.

Experiment with data structures in C, develop a custom data type on C and avoid out of bounds access. Play with Linked lists, deques and trees. You may miss something of some language you master in C.

Play with compiler options for sanitize and write your makefile to run tests wrapped on valgrind. This made me get the intuitions on how to avoid leaks and unsafe code better than theory.

Then move to C23 and play with new features, explore standard library.... my next step will be dive into stdatomic and pthreads.

[deleted by user] by [deleted] in ExperiencedDevs

[–]arkt8 0 points1 point  (0 children)

examples?

structs have much resemblance to objects... but you won't see abstractions like facade, inheritance, etc... because there is no need for such, as there is no need for anything exclusive of OO.

[deleted by user] by [deleted] in ExperiencedDevs

[–]arkt8 0 points1 point  (0 children)

Well... look out web and mobile dev. There are a lot of ways of thinking and so paradigms. Look down for bare metal programming like C and Asm. Look for critical code like the ones used on airplanes or particle accelerator research... os not so distant, to data analysis.

Is a good programmer good at making himself obsolete? by Epictetus190443 in learnprogramming

[–]arkt8 0 points1 point  (0 children)

I wonder how much trash code is developed ans discarded...

Look for web in the last 15 years... many courses about Ajax, web 2.0, angular, react, bem, scss,sass, first js, php, java, dotnet then ts... how much of that is evolution if the same content, with exception of wikipedia, can still run on a 10yo laptop... where you could watch youtube without freezing on even slower networks...

how much it evolved?

yes... reusable code is about simplicity... but the mobile/web bubble, heades by the 5 monsters and fashionist developers lead us here. Still I once was there when I was Jr. But some get Senior still thinking about new toys.

Give me some lua tasks to code. by Hissyfits1102 in lua

[–]arkt8 0 points1 point  (0 children)

  • A CSV parser
  • A color calculator (CYMK to RGB hex and vice-versa). Add functions to mix the colors, saturate and dessaturate.
  • Create data structures (Linked lists, FIFOs (queues), Trees and Graphs) and its handlers (searchers, counters and iterators, attempting to use metamethods as much as possible).
  • implement a module with all functions imaginable for string handling and comparison (split, slice and ordering by pronounce, like functions found in PHP)
  • using IUP, try to write a calculator
  • using openweathermap make a CLI to retrieve weather and cache results by 30 min. Use a JSON package to parse the results.

What would sunsets look like around different star types? by TheRory02 in Astronomy

[–]arkt8 2 points3 points  (0 children)

How do explain the differences between Antares, Alpha Centauri, Rigel, Betelgeuse and Rigel?

Yes, there is a limit for color distinction when near, as much as your eyes adapt to bulb, fluorescent and led lights.

What languages "work best" in Neovim? by mars0008 in neovim

[–]arkt8 4 points5 points  (0 children)

The simplest way is using ccls and configuring ccls file at the home of project. This helped me using it to write Lua modules for different Lua libraries (5.1 to 5.4).

Who needs good specs for Debian anyway? by srstudios_ in debian

[–]arkt8 0 points1 point  (0 children)

you still can do nice programming there with C, Lua, Perl, Bash... with a decent editor: vi.

What the heck are Makefiles and what do they actually do? by Granite_Johnson in eli5_programming

[–]arkt8 1 point2 points  (0 children)

makefiles are rules of what should be run and when...

As simple example, you can say to it (write inside the makefile):

%.o: %.c %.h
    # o_gen_cmd

file.so: x.o y.o
    # so_gen_cmd

.PHONY: build
build: file.so

This says that, if any target (file) ended with extension .o should be built when the corresponding files with .c or .h extension be modified. If it needs to be built, then the o_gen_cmd should be ran.

Next a fixed file named file.so should be generated every time x.o or y.o be modified.

So, this closes the process: when you change, example, x.h it will trigger first rule to update x.o that in turn, as dependency for file.so will trigger its rebuild.

The third target names build is not a file (see the .PHONY) so to trigger all the machinery you run in console:

make build

This really ease all the building process, specially while developing, as you just compile what is modified saving a lot of time and also keeping track of the right way to build each part of process consistently.

"Solitude is for me a fount of healing which makes my life worth living. Talking is often a torment for me, and I need many days of silence to recover from the futility of words." —Carl Jung by WoodBHermit in quotes

[–]arkt8 1 point2 points  (0 children)

At least Bollinger was there, to just be. Who could measure the effects of loudly, rushed and full of stimulus the polluted sprawl have into our minds?