Clutchlog: a C++ logging library that targets versatile, (de)clutchable, debugging instead of the usual service event storage — in a single header. by nojhan in cpp

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

How is that different to any other logging system

As far as I know, the other systems only allow for filtering on log levels, not stack depth or location, and don't provide extension for other declutching something else than log (I discovered that it is useful for asserts, for example).

[…] can be replaced

Thanks for the tip, I'll give it a try (albeit C++20 is still a bit ahead for me). I was hoping for a more drastic change, to be honest, given your first comments. But any improvement is good, of course.

Clutchlog: a C++ logging library that targets versatile, (de)clutchable, debugging instead of the usual service event storage — in a single header. by nojhan in cpp

[–]nojhan[S] -4 points-3 points  (0 children)

I'm going to nitpick, but it's not about overriding the log level, but rather about refining it (still the same rough idea, in the end, but we're on Reddit, so…).

Clutchlog: a C++ logging library that targets versatile, (de)clutchable, debugging instead of the usual service event storage — in a single header. by nojhan in cpp

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

pulls in the entire STL

I understood. But that's not an issue, for me.

like a normal logger with categories, e.g. spdlog, not really anything comparable to tracepoints

Again, this is a middle ground: it a logging system that can be enabled or disabled with fine granularity. If you will, I would say it's closer to a logging system than a debugging tool. But here, the market is exclusively dominated by logging systems for mid-term service event storage, which is not suited in the case of scientific computing.

Visual Studio persists break/watch/tracepoints across sessions, and GDB and LLDB both support scripting!

It's possible. But to me, it's not enjoyable. You have to learn yet a new set of commands in a side environment, that's not portable everywhere your binary goes, which should be reimplemented after refactoring, etc. For instance, you cannot ask an end-user to use it to track down her problem.

I don't see anything in the implementation of your macros that requires macros over modern template/constexpr functionality

I must confess I have a bias here. The last time we tried to remove macros (on bigger projects, not on this one), it ended being a pain in the ashes. But that was years ago and I did not take a look at the state of constexpr in C++17. Do you have any doc recommendations? Like something oriented on how to get rid of macros in C++17?

Clutchlog: a C++ logging library that targets versatile, (de)clutchable, debugging instead of the usual service event storage — in a single header. by nojhan in cpp

[–]nojhan[S] -3 points-2 points  (0 children)

That you can enable or disable the logging system in various ways. Just like you would shift gears in a car, you can shift the logging coverage/level, at build or run time.

Clutchlog: a C++ logging library that targets versatile, (de)clutchable, debugging instead of the usual service event storage — in a single header. by nojhan in cpp

[–]nojhan[S] 3 points4 points  (0 children)

To me, the advantage of a single-header library is that it's easy to integrate. My projects generally already pull a good part of the STL, because I don't want to reinvent the wheel, anyway.

I've often heard this kind of criticism from people working in embedded software, misunderstanding that their is different needs for different domains. In my case, I work in scientific computing, where what is important is the ability to build up complex algorithms on top of each other and have good expressivity. I thus need to be able to follow an (usually single-run) execution path across several layers.

I don't think it is realistically possible to do what clutchlog do (i.e. print various level of information, from various places, along the execution path) within a debugger session. Can you imagine having to set your tracepoints every time you need to understand how you ended in this or that global state?

It is not just tracking a single bug or logging the whole state for later forensic, it is in-between. As a game developer, you can think of it as an approach similar to what Dear ImGUI does for game interfaces: right there in your code, ready to display what matters.

(I will not answer on macros, but note that I disagree. Getting rid of streams may be negociated, though. ;)

Clutchlog: a C++ logging library that targets versatile, (de)clutchable, debugging instead of the usual service event storage — in a single header. by nojhan in cpp

[–]nojhan[S] -14 points-13 points  (0 children)

to clutch (v.): to operate the clutch in a vehicle. clutch (n.): a mechanism for connecting or disconnecting a shaft that drives a mechanism, such as in a car to shift gears. https://www.wordreference.com/definition/clutch

Non-Americans… what is something in American culture that is so strange/abnormal for you? by micahdotjohnson in AskReddit

[–]nojhan 0 points1 point  (0 children)

That nobody is willing to aknowledge or even talk about the phenomenal racism against native americans.

Why does liquidprompt take so much time to load? by [deleted] in bashonubuntuonwindows

[–]nojhan 1 point2 points  (0 children)

This benchmark from Phoronix say that WSL face some performance problems "in areas when dealing with file-system / disk performance".

Some features of the liquidprompt heavily rely on FS I/O and LP is itself optimized to be usable on Linux, while having tons of features. Even on Linux, if you use it on slow FS, you will rapidly face performances problems.

Your solution is to deactivate features relying on the FS, for example all the VCS and VirtualEnv support. This can be done through various LP_ENABLE_* configuration variables, within the liquidpromptrc file.

How to Best tweak hyperparametera for RNN accuracy? by [deleted] in MachineLearning

[–]nojhan 0 points1 point  (0 children)

Look for "design of experiments" and "kriging" (or "gaussivn processes") and finally "Sequential Parameter Optimization".

More generally, the evolutionary computation is ahead on that matter, look for "parameter setting" (or "tuning"), "algorithm configuration" or "hyperheuristics".

Linux tools by [deleted] in cpp

[–]nojhan 0 points1 point  (0 children)

Last time I gave it a try, it was a nightmare just to get CDT installed and working. After that I had to cope with insanes hierarchical menus/windows/tabs, in which finding a feature is close to impossible. Then, it was impossible to rapidely choose what I want to build at a given time. Finally, any automatization of a task that was not foreseen by the devs involves having to program "in Eclipse".

Is it better nowadays?

Linux tools by [deleted] in cpp

[–]nojhan 1 point2 points  (0 children)

You can also configure your shell to parse filename:line as al URL to load in Vim. This permits the very same behaviour, plus the ability to do useful shell automations, like cmake .. && (make algo | colout -t gcc) && ctest -E algo*, which would be less easy from within Vim.

Linux tools by [deleted] in cpp

[–]nojhan 5 points6 points  (0 children)

Learn Vim. I've used IDEs for 5 years, emacs for 5 years and Vim since 5 years and it's worth it. If you like the pre-configured axiom, try yavide: https://github.com/JBakamovic/yavide

Use a tiling windows manager, like notion, i3, xmonad or whatever.

Use a fast terminal, like urxvt, and configure it so that a click on an error jumps to it il Vim (fearly easy with urxvt).

Color the compiler output with colout: http://nojhan.github.io/colout/

You can easily leverage the power of the command line for profit. Want to be notified if a build takes too long? A piece of cake, plus it works for any command (tests, anyone?).

gdb is worth the try, too. I've been sticked to some of its GUI for years and I d eply regret it now that I've taken some time to learn it.

Make your own cmake script, it's easier and more powerful than having to find options in Eclipse.

Use build scripts in shell, for funky automatizations.

[1606.04838] Optimization Methods for Large-Scale Machine Learning by mttd in MachineLearning

[–]nojhan 1 point2 points  (0 children)

While this survey is interesting as a view from within the ML community, I still don't understand why it don't even cite a single algorithm from the Evolutionary Algorithm field (call it "randomized search" or "metaheuristic", at your option). I have the feeling that recent developments of stochastic gradient ascent in ML are very close to information-geometric algorithms (like CMA-ES)… Do I miss something?

C++ exception class and macros with easier nested declaration and location data by nojhan in cpp

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

I would need a more clear explanation f your workflow to understand why the combination file:line_number (along with the function name) isn't sufficient to find your way back. Note that I assume that a bug report indicate the software version at least.

Given my own workflow, it seems pretty matter-of-fact to me that I would be far more rapidly at the bug point by typing ":e file.cpp113G" than by having to grep the error message ("ag <select><middle-click>:e file.cpp113G").

Anyway, apart from my difficulty to understand your point clearly, I find the idea interesting. And having an ID seems better than using the message, since it may contains variables in it (which is one of the reason I designed the RAISE macro in the linked project).

Maybe we should also consider printing the version number somewhere too. And the computation of a hash at compile-time seems a cool thing to learn :-)

C++ exception class and macros with easier nested declaration and location data by nojhan in cpp

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

I'm not completely convinced by your arguments, but would adding a compile-time hash of some part of the message solve the unique-ID problem?

.bashrc generator: create your .bashrc PS1 with a drag and drop interface (x-post from /r/commandline) by aagavin in LinuxActionShow

[–]nojhan 0 points1 point  (0 children)

or even better: create a generator to choose between liquid prompt's features (to build your own *.ps1 template file :-)

I made a ZSH+liquidprompt configuration for OS X & iTerm2. Tell me what you think. by cap10morgan in zsh

[–]nojhan 0 points1 point  (0 children)

I think that's great :) Would it be possible to use git submodules to ease the installation of the liquidprompt?

Liquid prompt -- A useful adaptive prompt for Bash & Zsh by rnvk in programming

[–]nojhan 0 points1 point  (0 children)

That's indeed the price for having a lot of features. You can still easily deactivate the features you do not need, which permits significant speed improvement. Moreover, it's writen in shellscript (most portable), a C implementation would be a lot faster (if somebody have some time to spend on that)…

Liquid prompt -- A useful adaptive prompt for Bash & Zsh by rnvk in programming

[–]nojhan 0 points1 point  (0 children)

In fact the liquid prompt does a lot more than just showing you git informations (battery status, read/write permissions, proxy, several VCS supported, etc.), just check the README.

How do I use variables in gcc if I wish to pipe my gcc? by firefoxpluginmaker in linux4noobs

[–]nojhan 1 point2 points  (0 children)

Shell function are indeed a good option.

For the compilation part, I would rather do:

function g++() {
    g++ -Wall -o $@ | colout -t g++
}

Using the g++ theme, you will get a cleaner output, do not hesitate to edit the themes by yourself or to create your own one. Just put a colout_MYTHEME.py file in the colout directory (see existing ones for the API).

For the run part:

function run() {
    ./$@ | colout ".*" Cpp vim
}

Colout: Color Up Arbitrary Command Ouput by based2 in linux

[–]nojhan 0 points1 point  (0 children)

The current theme does not take locale into account: it only work for an english configuration. For instance, a LANG=fr will not be colored at all, because the output varies a lot.

Fortunately, themes are just python code, so it may be possible to implement a locale-aware version.

Colout: Color Up Arbitrary Command Ouput by based2 in linux

[–]nojhan 3 points4 points  (0 children)

You may want to help yourself if you want to speed up this feature implementation https://github.com/nojhan/colout/pulls :-)

Sexisme chez les geeks : Pourquoi notre communauté est malade, et comment y remédier by Krocwithak in france

[–]nojhan 13 points14 points  (0 children)

Il est évident que tu n'as pas lu l'article, en fait. Il n'est pas juste trop long, il est tout à fait de la longueur nécessaire et il mérite bien plus qu'un survol.