Individuals reproduce and mutate
You are giving very short names and commneting next to them the meaning

const nbloci = 100         # length of the genome
const N = 100              # Number individuals in the population
const nbgenerations = 100  # number of generations
const mu = 1/10^5          # mutation rate
const s = 0.01             # effect of a given mutation on fitness


It would be better to give long and self-explanatory names without comments:

const genome_length = 100
const population_size = 100 
const no_generations = 100
const mutation_rate = 1/10^5
const s = 0.01                # effect of a given mutation on fitness # Too criptic for  me to understand




Many beginners think:


  If I write many many many comments everywhere in my code, it will for sure become better!


But this is not True, you should remove all the meaningless comments such as:


# Settings
# Packages
# Type and Functions





  Maybe using functions will slow down my code very much?


No, the opposite, code inside functions runs much faster.

But you should 


  Avoid writing overly-specific types


(Reference is again the link above).



for l = I.Genome


Readibility counts, avoid using names like l and I because it is easy to mistake one for the other.

mutpos = mutposs


same as above.




  Is there a way to improve the calcfitness step, maybe by coding
  true/false instead of 1/1-s?


No, fitness must be a number, if you use a true/false value for the fitness then you are not searching genetically but randomly.